From 8f22d92eec71e7b744230aa7a42f20ba952fb7dd Mon Sep 17 00:00:00 2001 From: "Freena S. Koikoi" Date: Tue, 5 Dec 2023 13:23:02 +0000 Subject: [PATCH] challenge5 --- chapter3_challenge5.py | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 chapter3_challenge5.py diff --git a/chapter3_challenge5.py b/chapter3_challenge5.py new file mode 100644 index 0000000..5aca4f7 --- /dev/null +++ b/chapter3_challenge5.py @@ -0,0 +1,36 @@ +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) +