Question: print ( Problem 1 1 ) In Python, you can create a random number using the random module, which comes pre - installed
printProblem
In Python, you can create a random number using the random module, which comes preinstalled 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.randinta b where a is the smallest possible number and b is the largest. For example:
randominteger random.randint # This will give you a random integer between and
Create a new menu item named P Problem
Create a new choice in the conditional menu system
Create a random number.
Using a while loop, ask the user for a number from to
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 randominteger 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
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
