我试图找出我的错误在下面的代码中,这是关于猜一个字.
如果我输入缺失的单词,"ghost"它应该结束游戏,但它会继续要求它.
我的错误在哪里?
number = 0
missword = "ghost"
while number < 3:
guess = input("What is the missing word? ")
if guess != "ghost":
print("Try again")
number = number + 1
elif guess == missword:
print("Game Over")
else:
print("Game over")
Run Code Online (Sandbox Code Playgroud) python ×1