if userInput != userPassword:
print("I'm sorry, that is wrong please try again. Try to remember capitals!")
elif userInput == userPassword:
print("That is correct you may now find out your mobile phone costs!")
mobile_phone()
当运行时,我输入了错误的密码,它只是重复第一个打印语句(对不起,这是错误的,请再试一次)。尽量记住大写字母!)我如何才能让它只是再次运行一次,如果它是错误的,那么也许是另一个时间,直到它回答了正确的密码。首次登场
把它放在一个循环中?你知道吗
如果你想限制try的数量,比如说3,只需添加一个计数器:
相关问题 更多 >
编程相关推荐