Question: using python write code for generates a random number in the range of 1 through 1 0 0 asks the user to guess what the
using python write code for generates a random number in the range of through
asks the user to guess what the number is
If the users guess is higher than the random number, the program should display Too high, try again and have the user guess again remember keep the same original random number for each guessIf the users guess is lower than the random number, the program should display Too low, try again and have the user guess again remember keep the same original random number for each guessIf the user guesses the number, the application should congratulate the user and ask the user if they wish to play again if so use a new random number
Create and use functions to:
Get the users input on whether they wish to play the game if they wish to play, then the two functions below will runCalculate the random numberObtain the users guess and determine whether its correct or not
Hints:
Import and use the Python random module to generate the random numberUse if elif to evaluate the users guess, and to keep the user guessing until they guess the correct valueUse a while loop or perhaps for loop if you prefer to control the process that occurs based on whether the user wishes to play the game or not.
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
