虽然循环没有与i相同的条件破坏

时间:2017-09-18 19:53:58

标签: python python-3.x if-statement while-loop user-input

我正在尝试使用相同条件的if语句,当while条件为真时,我的代码会向用户吐回响应,问题是,即使用户键入“是”/“否” ,它会吐出if语句,但它不会破坏循环,这是我的代码,有什么想法吗?

print("Do you kill it for the stick? (Yes/No/Help)")
userInput = input()

while userInput != "Yes" or "No":
    Help = "Do you kill the ant or not? Yes/No"
    if userInput == "Yes":
        print("Wow, you're a monster, ok then")
    elif userInput == "No":
        print("Woos...")
    elif userInput == "Help":
        print(Help)
    else:
        print("You've gotta choose!")
    userInput = input()
    Help = ""

0 个答案:

没有答案