Question: print ( Problem 1 1 ) In Python, you can create a random number using the random module, which comes pre - installed

print("Problem 11")
In Python, you can create a random number using the random module, which comes pre-installed with Python. Before you can use it, you need to import the module at the beginning of your script.
import random
If you want a random integer within a range, you can use random.randint(a, b) where a is the smallest possible number and b is the largest. For example:
random_integer = random.randint(1,10) # This will give you a random integer between 1 and 10.
Create a new menu item named P11- Problem 11
Create a new choice in the conditional menu system
Create a random number.
Using a while loop, ask the user for a number from 1 to 100.
Continue asking the user for a number until they enter the correct number.
If the guessed number is too low, print too low!
If the guessed number is too high, print too high!
Print the percentage of correct answers.
Print the percentage of incorrect answers.
Hint: When testing your program, you might want to print the value of random_integer to see if your too high or too low messages are correct.

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 Programming Questions!