def main():
game()
restart = input("Would you like to play again? Please enter '1' for YES or '2' for NO: ")
while restart == 1:
game()
print restart
else:
print "Thanks for playing!"
main()
I know I've created an infinite loop, but I'm not sure how to refine it to ask every single time the game ends, until the user DOESN'T enter "1" in which case it would print what is after the else statement. It sounds like a sentinel loop, but I'm just having a brain fart, would be great if I got a little advice! Thanks

New Topic/Question
Reply




MultiQuote







|