Lesson 5: Multiplication test

posted Nov 28, 2018, 8:06 AM by Attila Lengyel
print("What is 7 x 7?")
answer = int(input())

if answer == 49:
print("Good job! Correct.")
print(" 7 x 7 is", 7 * 7)
else:
print("No. Incorrect")
print("How could 7 x 7 be", answer, "???")
print("Try again!")

import random
a = random.randint(1,10)
b = random.randint(1,10)

print("What is", a, "x", b, "?" )
answer = int(input())
if answer == a * b:
print("Correct")
Comments