Create a function that randomly generates and return integer


Problem

I. Write a program to help an elementary school student learn multiplication. Create a function that randomly generates and return two positive one-digit integers. Use that function's result in your program to prompt the user with a question, such as: How much is 3 times 5? For a correct answer, display the message "Well done!" and ask another multiplication question.

For an incorrect answer, display the message "No. Please try again." And let the student try the same question repeatedly until the student finally gets it right.

II. The factorial of a positive integer r1 ( written n!) is the product 1 * 2 * 3 ... n. Design and write a program that asks the user to input a positive integer and then calculates and displays the factorial of the number. The program should call a function named getN that gets the input and guarantees that the _ input is a positive number (input validation).Also, the factorial of the number input should be calculated with a function named fact.

Sample run

Enter a positive integer: 6

6! is 723.

Request for Solution File

Ask an Expert for Answer!!
Python Programming: Create a function that randomly generates and return integer
Reference No:- TGS03323522

Expected delivery within 24 Hours