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/chapter3_challenge5.py

37 lines
653 B
Python

from random import randint
num1 = randint(1, 10)
num2 = randint(1, 10)
print(f"what is {num1} times {num2}")
#Challenge2
num1 = randint(1, 10)
num2 = randint(1, 10)
print(f"what is {num1} plus {num2}")
final = num1 + num2
print(final)
#Challenge3
num1 = randint(1, 10)
num2 = randint(1, 10)
print(f"what is {num1} times {num2}")
answer = int(input("type your answer!"))
print(answer)
#Challenge4
for number in range(10):
if number % 3 <= 0:
print(number)
#Challenge5
answer = int(input(f"What is {num1} time {num2 } \n" *2))
if num1 * num2 == answer:
print("Yes")
else:
print("No, Your correct answer is", num1 * num2)