This Python script is a fun and interactive game where the player attempts to guess a randomly chosen number between 1 and 100. Each time the player makes a guess, the game provides a hint of whether the guess is too high or too low, and the player's score decreases with each incorrect guess.
No additional libraries are required to run this script as it only uses Python's built-in random module.
Save the script in a file named guess_number.py. Open your terminal or command prompt. You can just navigate to the directory where the script is located. Run the script using Python: "python3 guess_number.py"
When prompted, you can just enter your guess for the number. The number will be between 1 and 100. After each guess, you will receive a hint: either your guess is too high or too low. The game starts with a score of 100. Each incorrect guess will decrease your score by 10 points. The game continues until you guess the correct number or your score reaches 0. If you guess the number correctly, the game will congratulate you and display your score. The game will reveal the correct number if your score reaches 0 before you guess the number.