简单的问题,但它使我疯了。为什么当我运行这个代码时,它只是不断重复自己?而且我的缩进是正确的,只是不得不将空间放置4次,无论出于何种原因。虽然Python循环不断重复自己
高分
0 - 退出 1 - 显示比分
的源代码:
scores = []
choice = None
while choice != "0":
print(
"""
High Scores
0 - Exit
1 - Show Scores
"""
)
choice = input("choice: ")
print()
if choice == "0":
print ("exiting")
elif choice == "1":
score = int(input("what score did you get?: "))
scores.append(score)
else:
print ("no")
input ("\n\nPress enter to exit")
你_sure_你正在运行的Python 3? –
sayan 98是我的while循环下的身份。谢谢 –
@JacobMoore乐于帮忙! – sayan