1-4 邏輯運算
age = 15
if age > 20:
print('全票')
else:
print('半票')半票age = 15
price = 200
#20歲以上多收50元
if age > 20:
price += 50
print(price)200
Last updated
age = 15
if age > 20:
print('全票')
else:
print('半票')半票age = 15
price = 200
#20歲以上多收50元
if age > 20:
price += 50
print(price)200
Last updated
age = 8
price = 200
#80歲以上或10歲以下少收50元
if age > 60 or age < 10:
price -= 50
print(price)150age = 8
#80歲以上或10歲以下少收50元
if 10 <= age <= 60:
price = 200
else:
price = 150
print(price)150