Upload files to ''
parent
4e932e2cd9
commit
236ff0c124
@ -0,0 +1,39 @@
|
|||||||
|
from random import randint
|
||||||
|
num1 = randint(1,10)
|
||||||
|
num2 = randint(1,10)
|
||||||
|
|
||||||
|
#challenge 1
|
||||||
|
solution = num1 * num2
|
||||||
|
print("What is " + str(num1) + " times " + str(num2) + "? ", solution)
|
||||||
|
|
||||||
|
#challenge 2
|
||||||
|
solution = num1 + num2
|
||||||
|
print("What is " + str(num1) + " plus " + str(num2) + "? ", solution)
|
||||||
|
|
||||||
|
#challenge 3
|
||||||
|
question = f"What is {num1} times {num2}? "
|
||||||
|
answer = int(input(question))
|
||||||
|
|
||||||
|
if num1 * num2 == answer:
|
||||||
|
print("correct")
|
||||||
|
|
||||||
|
else:
|
||||||
|
print("incorrect")
|
||||||
|
|
||||||
|
#challenge 4
|
||||||
|
for number in range(1,12):
|
||||||
|
if number % 2 <= 0:
|
||||||
|
print("result")
|
||||||
|
|
||||||
|
#challenge 5
|
||||||
|
question = f"What is {num1} times {num2}? "
|
||||||
|
answer = int(input(question))
|
||||||
|
|
||||||
|
question = f"What is {num1} times {num2}? "
|
||||||
|
answer = int(input(question))
|
||||||
|
|
||||||
|
if num1 * num2 == answer:
|
||||||
|
print("you got it right")
|
||||||
|
|
||||||
|
else:
|
||||||
|
print("wrong, the correct answer is:", num1 * num2)
|
Loading…
Reference in New Issue