Question: Problem 4 : Guess the Number Game Write a program that allows the user to guess a randomly generated number within a specified range. Use
Problem: Guess the Number Game
Write a program that allows the user to guess a randomly generated number within a specified range.
Use the random module to generate a random integer between and
Create a function guessnumbertarget that repeatedly asks the user to guess the number until they guess correctly. Provide hints if the guess is too high or too low.
Keep track of the number of attempts and display it once the user guesses the number.
Guess the number:
Output: Too high!
Guess the number:
Output: Too low!
Guess the number:
Output: Correct! It took you attempts.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
