From 54bbccd23e7903db0ea28b38b768f90eea253c9f Mon Sep 17 00:00:00 2001 From: "Freena S. Koikoi" Date: Fri, 8 Dec 2023 16:10:08 +0000 Subject: [PATCH] completing sheet 2 --- sheet2_completion.py | 56 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 sheet2_completion.py diff --git a/sheet2_completion.py b/sheet2_completion.py new file mode 100644 index 0000000..c9be27a --- /dev/null +++ b/sheet2_completion.py @@ -0,0 +1,56 @@ +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) + +#Challenge6 +for number in range(80, 150): + if number < 100: + print(number) + + else: + print('bigger than 100') + +#Challenge7 +for number in range(80, 150): + if number < 100: + print('Not Bad!') + + elif number > 100: + print('Good') + + else: + print('equalibrium') + +#Challenge8 \ No newline at end of file