Question: ( 1 ) ( 5 points ) At the top of your file, import the math and random modules. Use an input statement with a

(1)(5 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:
(2)(20 points) Write code which will do the following repeatedly, until the user correctly guesses the number N :
Prompt the user to enter a guess.
Print one of the following messages, as appropriate: "Your guess is too sma11.", or "Your guess is too large.", or "You guessed correctly"!
After the user has correctly guessed the number, congratulate them if they succeeded with max_guesses_needed 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 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!