Record#
Today's exercise is a math game that uses a for loop to output calculation questions and keeps track of the final score.
CODE#
print("Math game!")
print()
score = 0
n1 = int(input("Enter the number you want to practice: "))
for i in range(1, 11):
n0 = "{} * {} = ".format(i, n1)
n2 = int(input(n0))
if n2 == (i * n1):
print("Correct, great job.")
score += 1
else:
print("Oops, wrong answer. The correct answer is:", i * n1)
print("Your score is:", score, ".")