我在=
整数字面之前的65
符号出现语法错误。有人可以帮我弄清楚如何解决语法错误吗?
age = int(input('Age? '))
if age <= 15 or >= 65:
print('Discount Applied.')
else:
print('Discount ineligible.')
答案 0 :(得分:2)
您需要在条件中再次指定age
:
age = int(input('Age? '))
if age <= 15 or age >= 65:
# ...
答案 1 :(得分:0)
age = int(input('Age? '))
if 15 < age < 65:
print('Discount ineligible.')
else:
print('Discount Applied.')