Oct-12-2021, 12:56 PM
"Do some stuff" is where you call your function that plays the game.
def play_game(): '''code for playing my game''' while True: inp = input('Would you like to play my wonderful game? ') if len(inp) == 0 or inp[0].upper() != 'Y': break play_game()This loop requires the user to input some kind of YES, Yes, yes, yup, y, Y to play otherwise it exits. If you want to play the game at least once you make a slight change.
def play_game(): '''code for playing my game''' while True: play_game() inp = input('Would you like to play my wonderful game? ') if len(inp) == 0 or inp[0].upper() != 'Y': break