Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Advances In Knowledge Discovery In Databases

Authors: Animesh Adhikari, Jhimli Adhikari

1st Edition

3319132121, 9783319132129

More Books

Students also viewed these Databases questions

Question

Explain the function and purpose of the Job Level Table.

Answered: 1 week ago