0
在我的數學測驗代碼中,當我再次輸入N時再次輸入N時,它會再次播放。這裏是我的代碼:再次播放不起作用
def play_again():
again= input("would you like to play again? y for yes and n for no")
while again not in ['Y','y','N','n']:
again = input("please enter 'Y' or 'N'")
if again== 'y' or 'Y':
do_the_quiz()
else:
print("cheers lad thanks for playing")
exit()
你可以發現一些錯誤的東西讓N或N再次播放它不應該。
嘗試在控制檯中輸入「'n'=='y'或'Y'' – 2015-04-01 21:24:13