Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Exercise: Number guessing game - save to file

Level 7

  • Create a file called number_guessing_game_7.py
  • Based on the previous solutions.
  • When starting a new game ask the user for their name and save the game information in the file.
  • The hidden number and the guesses.
  • Have an option to show the previously played games.