Question: In python. use only the for and while loops Question 7: Implement a number guessing game. The program should randomly choose ain integer between 1

In python. use only the for and while loops

 In python. use only the for and while loops Question 7:

Implement a number guessing game. The program should randomly choose ain integer

Question 7: Implement a number guessing game. The program should randomly choose ain integer between 1 and 100 (inclusive), and have the user try to guess that number. Implementations guidelines: 1. The user can guess at most 5 times 2. Before each guess the program announces: * An updated guessing-range, taking in to account previous guesses and responses The number of guesses that the user has left. . 3. If the user guessed correctly, the program should announce that, and also tell how many guesses the user used. 4. If the user guessed wrong, and there are still guesses left, the program should tell the user if the number (it chose) is bigger or smaller than the number that the user guessed. 5. If the user didn't guess the number in all of the 5 tries, the program should reveal the number it chose 6. Follow the execution examples below for the exact format. Execution example 1: I thought of a number between 1 and 100! Try to guess it. Range: [1, 100], Number of guesses left: 5 Your guess: 15 Wrong! My number is bigger. Range: [16,100], Number of guesses left: 4 Your guess: 34 Wrong! My number is smaller. Range: [16, 33], Number of guesses left: 3 Your guess: 23 Congrats! You guessed my number in 3 guesses Execution example 2: I thought of a number between 1 and 100! Try to guess it. Range: [1, 1001, Number of guesses left: 5 Your guess: 15 Wrong! My number is bigger. Range: [16,100], Number of guesses left: 4 Your guess: 50 Wrong! My number is smaller

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!