-1 python
这是我一直在使用的代码,但它没有工作,因为它说elif语句是无效的语法.任何人都可以帮助我,因为我是python的初学者.
age = int(input('How old are you?: '))
if age <= 16:
print ('You are too young to enter this section of the program!')
else:
age >= 16
print ('Welcome to the advanced section of the program!')
elif: password = int(input('please enter the password to enter the elite members section: ')):
if password == ('muffin'):
print ('Well done for unlocking the secret part of the program')
else:
print ('You shall not pass!')
Run Code Online (Sandbox Code Playgroud)
elif需要一个状态(即elif 7 > 5:....)也是一个elif不能跟随的else和必须遵循一个if或elif条件
在你的情况下,你elif没有条件,所以python不知道该怎么做
你elif也跟着你else我不确定你真正期望它做什么...
| 归档时间: |
|
| 查看次数: |
148 次 |
| 最近记录: |