Question: Implement a program that: Prompts the user for a level, n . If the user does not input 1 , 2 , or 3 ,
Implement a program that:
Prompts the user for a level, n If the user does not input or the program should prompt again.
Randomly generates ten math problems formatted as X Y wherein each of X and Y is a nonnegative integer with digits. No need to support operations other than addition
Prompts the user to solve each of those problems. If an answer is not correct or not even a number the program should output EEE and prompt the user again, allowing the user up to three tries in total for that problem. If the user has still not answered correctly after three tries, the program should output the correct answer.
Ultimately outputs the users score: the number of correct answers out of
Must include comments with your name, date, program name, and program purpose.
Must include a main function with if namemain: code.
Structure your program as follows, wherein the function getlevel prompts and if need be reprompts the user for a level and returns or and the function generateintegerreturns a randomly generated nonnegative integer with level digits or raises a ValueError if level is not or Note level represents the number of digits that each operand in the equation should have:
import random
def main:
def getlevel:
def generateintegerlevel:
if namemain:
main
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
