Question
Python: Use the random module to generate two positive integers so that the program starts by displaying a question such as: How much is 10
Python: Use the random module to generate two positive integers so that the program starts by displaying a question such as:
How much is 10 times 5?
To keep things simple, the randomly generated integers should be between 2 and 12.
The student should be able to answer the question and the program will verify if the answer they type is correct. If the student is incorrect, the program should print "Incorrect. Please try again." and wait for another answer for the same question.
If the student is correct, the program should randomly choose among a list of words to display to congratulate them (e.g. "Good job!", "Excellent!", "Fantastic!"). After printing a randomly chosen response, the program should then ask another multiplication question.
If at any point the student enters quit, the program should terminate. You may assume that the student will only type either an integer value or the word quit.
Test your program: Answer the first two generated questions correctly, then answer the subsequent question with two incorrect answers followed by the correct answer.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started