Skip to content
Sign upLog in
Beginner - ending a game
Profile icon

Hi! I can't figure out how to make it so that the game ends when the user types "no" into the restart()) section under my code.
I'm a beginner, and I am quite frustrated :(

You are viewing a single comment. View All
Profile icon

To end a game, just first do import sys
Then place sys.exit() where you want it to stop.
I wouldn’t recommend doing sleep(999) because then the user might not know if the repl is done or not.

Hope this helps!