Question: What your Python program should do You will create a program that will try to guess a number that the user is thinking of between

What your Python program should do You will create a program that will try to guess a number that the user is thinking of between 1 and 20. The program should accept input from the user as to whether the guess was too high or too low, and change the next guess accordingly. The program starts by guessing a random number between 1 and 20. This has been done for you. 1. Tell the user what number the computer guessed. 2. Ask the user to enter h if the guess was too high, I (lowercase L) if the guess was too low, or c if the guess was correct. All letters are lowercase and without quotes. 3. If the guess was correct, print a funny congratulations message and exit the program. 4. If the guess was too high, subtract from the guess a random number between 1 and 4. Use this new number as the next guess. a. Note: it's possible that doing this will result in a guess that's below 0, which doesn't make sense. Add some code to check if the new guess is below 0, and if it is, set the new guess equal to 1. 5. If the guess was too low, add to the guess a random number between 1 and 4. a. Here, it doesn't make sense to have a guess above 20. Add some code to check if the new guess is above 20, and if it is, set the new guess equal to 20. Tell the user each new guess and let the user continue providing input. The program should run until the user enters "c" (no quotes), signaling the end of the game
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
