Need help in how to create, using python programming, a simple tutoring game whi
ID: 3677044 • Letter: N
Question
Need help in how to create, using python programming, a simple tutoring game which helps the user practice multiplication skills. In this game, the program displays two random integers between 1 and 10 (inclusive), and asks the user to enter the product of the two integers. The program tells the user if he or she entered the correct answer, and then asks if the user wants to try another question. When the user decides to end the game, the program displays the number of correct answers and the total number of questions attempted. confused on how to even get started...
Explanation / Answer
This below python implementation will solve the as per given problem statement.
Read the two random numbers between 1 to 10
Asked the used enter product and validated the answer is right or not
Print the total number of questions and right answers.
Code:
olution for Question :
from random import randint
play = True
count = 0
total = 0
while play:
a = randint(1,10)
b = randint(1,10)
result = a * b
x = input("Enter a * b : ")
total = total + 1
if result == x :
print "Answer Right"
count = count + 1
else:
print "Answer is"+result
if input("Play again? ") == "no":
play = False
print "total number of question are "+ total
print " Right Answers are "+count
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.