π― Number Guessing Game (Python)
A simple and fun Number Guessing Game written in Python. The player selects a difficulty level, and the program generates a random number. Your goal? Guess the number in as few attempts as possible!
-
Three difficulty levels:
- Easy: 1 to 50
- Medium: 1 to 100
- Hard: 1 to 500
-
Input validation for better user experience
-
Hints whether your guess is too high or too low
-
Tracks the total number of attempts
-
Option to quit anytime
-
Run the Python script:
python number_guessing_game.py
-
Choose a difficulty level:
- 1 β Easy
- 2 β Medium
- 3 β Hard
-
Enter your guesses until you find the correct number.
-
The game will tell you:
- If your guess is too big
- If your guess is too small
-
When you win, the game shows your total attempts.
-
Choose to play again or exit.
-----Number Guessing Game-----
Choose Difficulty Level
1- Easy(1,50)
2- Medium(1,100)
3- Hard(1,500)
Enter Difficulty level 1/2/3 or Quit(Q) to exit: 2
Enter Your Guess or Quit(q): 45
Small Number, Guess Bigger Number
Enter Your Guess or Quit(q): 87
Big Number, Guess Smaller Number
Enter Your Guess or Quit(q): 71
Congrats!!! You Guessed it Right, Attempts: 3
π Number-Guessing-Game
βββ number_guessing_game.py
βββ README.md
Feel free to modify or enhance the logic and make it your own!