Question: Create the following function and call it from your main: def mathPractice ( ) : Write a function that will help a young student practice
Create the following function and call it from your main:
def mathPractice:
Write a function that will help a young student practice their math skills.
Print a 'welcome' message.
Within a loop, do the following:
Select two random integers from to Ask the user to enter the sum of these two nurrijers. For example, if the two random numbers selected were and your prompt should look as follows:
What is
Display whether or not they were correct. If incorrect, display the correct answer.
At any time, if the user enters 'quit', the loop should stop.
After the loop, display the total number of questions the user got right and wrong.
You may assume that the input is valid either a numeric answer or 'quit'
Example:
Welcome to math practice.
What is
User enters:
That's correct.
What is
User enters:
Sorry, the correct answer is
What is
User enters:
Sorry, the correct answer is
What is
User enters: quit
Number of questions correct:
Number of questions incorrect:
Thanks for playing
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
