条件中的语法错误

时间:2018-06-14 16:08:46

标签: python boolean syntax-error

我在=整数字面之前的65符号出现语法错误。有人可以帮我弄清楚如何解决语法错误吗?

age = int(input('Age? '))
if age <= 15 or >= 65:
  print('Discount Applied.')
else:
  print('Discount ineligible.')

2 个答案:

答案 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.')