when i run this code, and i input an invalid response, it works perfectly fine by asking me to input a valid response.
(当我运行此代码,并且输入无效的响应时,要求我输入有效的响应就可以很好地工作。)
But when i input an invalid response and it asks me to input again and I input a valid response, it doesn't break the loop.
(但是,当我输入无效的响应并且要求我再次输入并且输入有效的响应时,它不会中断循环。)
How do I fix this?
(我该如何解决?)
def plchoice():
global choice
global plchoice
plchoice = input("Rock, Paper, Or Scissors: ")
while plchoice not in ["rock", "Rock", "Paper", "paper", "Scissors", "scissors"]:
print("Invalid Choice! Pick Again.")
choice = input("Rock, Paper, Or Scissors: ")
ask by PythonBeginner69 translate from so 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…