Amazing-Python-Scripts
Number Guessing Game
This is a simple number guessing game implemented in Python. The program generates a random number between 0 and the user-specified range and challenges the player to guess the correct number.
Getting Started
To run the game, you'll need Python 3.x installed on your computer. If you don't have Python installed, you can download it from the official website: Python.org.
How to Play
- Clone or download this repository to your local machine.
- Open a terminal or command prompt and navigate to the project directory.
- Run the
number_guessing_game.py
script using the following command:
python number_guessing_game.py
- The program will ask you to input a range (a positive integer greater than 0) to generate a random number.
- After specifying the range, the program will generate a random number.
- You need to make guesses to find the correct number.
- The program will provide hints if your guess is above or below the generated number.
- Keep guessing until you find the correct number.
- The game will display the number of guesses it took to find the correct number.
Example Gameplay
Type a number: 100
Make a guess: 50
You were below the number!
Make a guess: 75
You were below the number!
Make a guess: 90
You were above the number!
Make a guess: 85
You were below the number!
Make a guess: 88
You got it!
You got it in 5 guesses
Feel free to contribute or make suggestions for improvements. Happy coding!