1-6 鍵盤輸入
print('請輸入年齡:')
age = int(input()) #輸入年齡
#80歲以上或10歲以下少收50元
if 10 <= age <= 60:
price = 200
else:
price = 150
print(price)try:
print('請輸入年齡:')
age = int(input()) #輸入年齡
#80歲以上或10歲以下少收50元
if 10 <= age <= 60:
price = 200
else:
price = 150
print(price)
except:
print('輸入錯誤!')Last updated