You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
CSC221/Week-2/mathquiz.py

65 lines
900 B
Python

from random import randint
#Challenge1
number_one = randint(1,10)
number_two = randint(1,10)
print(f"Challenge one\nWhat is {number_one} times {number_two}")
answer = number_one * number_two
print(answer)
#Challenge2
number_one = randint(1,10)
number_two = randint(1,10)
print(f"Challenge two\nWhat is {number_one} plus {number_two}")
result = number_one + number_two
print(result)
#Challenges3
number_one = randint(1,10)
number_two = randint(1,10)
answer = int(input(f"Challenge three\nWhat is {number_one} times {number_two} ?\n"))
#Challenge4
number_one = randint (1,10)
print(str(number_one) * 5)
#Challenges5
number_one = randint(1,10)
number_two = randint(1,10)
answer = int(input(f"Challenge five\nWhat is {number_one} times {number_two} ?\n"))
if number_one * number_two == answer:
print(f"Your answer {answer} is correct!!")
else:
print(f"Wrong")