A simple Python game where the player has to guess a number between 1 and 100 within a limited number of attempts, depending on the chosen difficulty level.
Project url: https://roadmap.sh/projects/number-guessing-game
- Difficulty levels:
- Easy → 10 attempts
- Medium → 5 attempts
- Hard → 2 attempts
- Feedback after each guess (
the number is higher/lower) - Option to replay after the game ends
-
Python 3.6+ installed on your system
-
Check your Python version:
python --versionor
python3 --version
- Clone or download this project.
- Open a terminal in the project directory (where game.py is located).
- Run the game with
python game.py
- At the start, select the difficulty by typing 1, 2, or 3.
- Enter numbers between 1 and 100 to try to guess the secret number.
- The game will tell you if the number is higher or lower.
- you run out of attempts, the correct number will be revealed.
- At the end, you can choose to play again by typing Yes, or quit by typing No.