Question: ( 1 ) ( 5 points ) At the top of your file, import the math and random modules. Use an input statement with a
points
At the top of your file, import the math and random modules.
Use an input statement with a prompt, asking the user to enter a positive integer B Following that code, insert the following:
points Write code which will do the following repeatedly, until the user correctly guesses the number :
Prompt the user to enter a guess.
Print one of the following messages, as appropriate: "Your guess is too sma or "Your guess is too large.", or "You guessed correctly"!
After the user has correctly guessed the number, congratulate them if they succeeded with maxguessesneeded or fewer guesses. Chastise them if they used more than required. The program should then exit gracefully you may not use break, or exit or similar your loop should just naturally terminate
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
