我试图让用户检查他们的个人资料时,要求他们所有的方式,这就是我正在做的。问题是,当我运行它时,我可以使用if函数的一个或while条件(使程序结束),但之后我就不知道发生了什么。它显然一直在循环,但程序没有结束,我不能使用其他if函数,有什么想法吗?你知道吗
print("ask about your stats")
userInput = input()
while userInput != "Pass":
if userInput == "Stats":
print(billyMays)
elif userInput == "Health":
print(health)
elif userInput == "Hunger":
print(hunger)
elif userInput == "Voice":
print(voice)
else:
pass
userInput = None
print("goodbye")
赋值
userInput = None
之后,while条件将永远保持True
,循环体实际上什么也不做。你知道吗相关问题 更多 >
编程相关推荐