From 89bc2a5aa1e93375159f381accac5aa0b1145465 Mon Sep 17 00:00:00 2001 From: Spencerscooper Date: Mon, 4 Dec 2023 21:33:17 +0000 Subject: [PATCH] challenge5 to 8 --- Week-2/mathquiz.py | 24 ++++++++++++++++++++++++ Week-2/mathquiz/challenge5.py | 10 ++++++++++ Week-2/mathquiz/challenge6.py | 5 +++++ Week-2/mathquiz/challenge7.py | 5 +++++ Week-2/mathquiz/challenge8.py | 10 ++++++++++ 5 files changed, 54 insertions(+) create mode 100644 Week-2/mathquiz/challenge5.py create mode 100644 Week-2/mathquiz/challenge6.py create mode 100644 Week-2/mathquiz/challenge7.py create mode 100644 Week-2/mathquiz/challenge8.py diff --git a/Week-2/mathquiz.py b/Week-2/mathquiz.py index b4c4e45..775cf29 100644 --- a/Week-2/mathquiz.py +++ b/Week-2/mathquiz.py @@ -38,3 +38,27 @@ else: print(f"Wrong") + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Week-2/mathquiz/challenge5.py b/Week-2/mathquiz/challenge5.py new file mode 100644 index 0000000..939ea7e --- /dev/null +++ b/Week-2/mathquiz/challenge5.py @@ -0,0 +1,10 @@ +from random import randint +#Challenges5 + +number_one = randint(1,10) +number_two = randint(1,10) +answer = int(input(f"What is {number_one} times {number_two} ?\n" * 2)) +if number_one * number_two == answer: + print(f"Your answer {answer} is correct!!") +else: + print(f"Wrong the correct answer is {number_one * number_two}") diff --git a/Week-2/mathquiz/challenge6.py b/Week-2/mathquiz/challenge6.py new file mode 100644 index 0000000..a35e06d --- /dev/null +++ b/Week-2/mathquiz/challenge6.py @@ -0,0 +1,5 @@ +userInput = int(input("Enter a valid number :")) +if userInput > 100: + print(" Great number ") + + diff --git a/Week-2/mathquiz/challenge7.py b/Week-2/mathquiz/challenge7.py new file mode 100644 index 0000000..e18399d --- /dev/null +++ b/Week-2/mathquiz/challenge7.py @@ -0,0 +1,5 @@ +userInput = int(input("Enter a valid number :")) +if userInput == 100: + print(" Tie ") + + diff --git a/Week-2/mathquiz/challenge8.py b/Week-2/mathquiz/challenge8.py new file mode 100644 index 0000000..9e52f6c --- /dev/null +++ b/Week-2/mathquiz/challenge8.py @@ -0,0 +1,10 @@ +from random import randint +#Challenges5 + +number_one = randint(1,10) +number_two = randint(1,10) +answer = int(input(f"What is {number_one} times {number_two} ?\n")) +if number_one * number_two == answer: + print("yes") +else: + print("No!!")