1. 程式人生 > >Python基礎-判斷

Python基礎-判斷

key python string keyword 基礎 python基礎 pri pan print

age = 3
if age >= 18:
    print(‘your age is‘, age)
elif age >= 10:
    print(‘your age is‘, age)
else: print(‘your age is‘, age)

s = input(‘birth: ‘)
birth = int(s)
if birth < 2000:
    print(‘00前‘)
else:
    print(‘00後‘)

Python基礎-判斷