From 24fd86538bddaa173f81781702581e0b3ef4d238 Mon Sep 17 00:00:00 2001 From: Temitayo Adebisi Date: Tue, 19 Aug 2025 21:03:30 +0100 Subject: [PATCH 1/9] Create sorting_hat --- 3-control-flow/sorting_hat | 95 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 95 insertions(+) create mode 100644 3-control-flow/sorting_hat diff --git a/3-control-flow/sorting_hat b/3-control-flow/sorting_hat new file mode 100644 index 0000000..2633b63 --- /dev/null +++ b/3-control-flow/sorting_hat @@ -0,0 +1,95 @@ +# The Sorting Hat project + +Gryffindor = 0 +Ravenclaw = 0 +Hufflepuff = 0 +Slytherin = 0 + +print("Q1) Do you like Dawn or Dusk?") +print (" 1) Dawn") +print (" 2) Dusk") + +Q1 = int(input(" Enter answer (1,2)")) + +if Q1 == 1: + Gryffindor = Gryffindor +1 + Ravenclaw = Ravenclaw +1 +elif Q1 == 2: + Hufflepuff = +1 + Slytherin = +1 +else: + print("Wrong input") + +#print(Gryffindor) +#print(Ravenclaw) +#print(Huffleclaw) +#print(Slytherin) +###### +print("==================================") + +print ("Q2) When I’m dead, I want people to remember me as:") +print ( "1) The Good") +print ( "2) The Great") +print ( "3) The Wise") +print ( "4) The Bold") +print("==================================") +Q2 = int(input(" Enter answer (1,2,3 and 4)")) + +if Q2 ==1: + Hufflepuff=Hufflepuff +2 +elif Q2 ==2: + Slytherin = Slytherin +2 +elif Q2 ==3: + Ravenclaw = Ravenclaw +2 +elif Q2 ==4: + Gryffindor = Gryffindor +2 +else: + print("Wrong input") + +######## +print("Q3) Which kind of instrument most pleases your ear?") +print ( "1) The violin") +print ( "2) The trumpet") +print ( "3) The piano") +print ( "4) The drum") +print("==================================") + +Q3 = int(input("Enter answer (1,2,3 and 4)")) + +if Q3 ==1: + Slytherin = Slytherin +4 +elif Q3 ==2: + Hufflepuff = Hufflepuff +4 +elif Q3 ==3: + Ravenclaw = Ravenclaw +4 +elif Q3 ==4: + Gryffindor = Gryffindor +4 +else: + print ("Wrong input") + +# Print out the score for each house +print("Slytherin:"+ str(Slytherin)) +print("Hufflepuff:" + str(Hufflepuff)) +print("Ravenclaw:" + str(Ravenclaw)) +print("Gryffindor:" + str(Gryffindor)) +print("==================================") + +# Figure out how to print out the house with the most points! + +if Slytherin >= Hufflepuff and Slytherin >= Gryffindor and Slytherin >= Ravenclaw: + print ("Slytherin! , the House with the most point") +elif Hufflepuff >= Gryffindor and Hufflepuff >= Ravenclaw and Hufflepuff>=Slytherin: + print ("Hufflepuff! ,the House with the most point") +elif Gryffindor >= Ravenclaw and Gryffindor >= Slytherin and Gryffindor>= Hufflepuff: + print("Gryffindor!, the House with the most point") + +else: + print ("Ravenclaw!, the House with the most point") + + + + + + + + From bbd4536208c1af3a8851ae79fe7220b95f05e837 Mon Sep 17 00:00:00 2001 From: Temitayo Adebisi Date: Tue, 19 Aug 2025 21:04:18 +0100 Subject: [PATCH 2/9] Rename sorting_hat to sorting_hat.py --- 3-control-flow/{sorting_hat => sorting_hat.py} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename 3-control-flow/{sorting_hat => sorting_hat.py} (100%) diff --git a/3-control-flow/sorting_hat b/3-control-flow/sorting_hat.py similarity index 100% rename from 3-control-flow/sorting_hat rename to 3-control-flow/sorting_hat.py From a0350b346f873d935b2e2081b6acaf5febac983a Mon Sep 17 00:00:00 2001 From: Temitayo Adebisi Date: Wed, 20 Aug 2025 19:45:38 +0100 Subject: [PATCH 3/9] Create Activities --- Activities | 1 + 1 file changed, 1 insertion(+) create mode 100644 Activities diff --git a/Activities b/Activities new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/Activities @@ -0,0 +1 @@ + From d89ab10753689d57e85776fa1cac68de0ab285c9 Mon Sep 17 00:00:00 2001 From: Temitayo Adebisi Date: Wed, 20 Aug 2025 19:48:16 +0100 Subject: [PATCH 4/9] Delete Activities --- Activities | 1 - 1 file changed, 1 deletion(-) delete mode 100644 Activities diff --git a/Activities b/Activities deleted file mode 100644 index 8b13789..0000000 --- a/Activities +++ /dev/null @@ -1 +0,0 @@ - From d0fbab1283fbb705154ac955217ef815c3aa86c2 Mon Sep 17 00:00:00 2001 From: Temitayo Adebisi Date: Wed, 20 Aug 2025 19:59:35 +0100 Subject: [PATCH 5/9] Create readme.md --- Self-project/readme.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 Self-project/readme.md diff --git a/Self-project/readme.md b/Self-project/readme.md new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/Self-project/readme.md @@ -0,0 +1 @@ + From 79ff76a8043fcd95f0367d3295a61f8f96ae9b64 Mon Sep 17 00:00:00 2001 From: Temitayo Adebisi Date: Wed, 20 Aug 2025 20:00:48 +0100 Subject: [PATCH 6/9] Create planet-weight --- Self-project/planet-weight | 59 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 Self-project/planet-weight diff --git a/Self-project/planet-weight b/Self-project/planet-weight new file mode 100644 index 0000000..93c568a --- /dev/null +++ b/Self-project/planet-weight @@ -0,0 +1,59 @@ +# create a weight conversaion program + +earth_weight = float(input("What is your Earth weight?:" + "")) +planet_num = int(input("Planet number?:"+"")) + + +# destination weight = earth weight x relative gravity + +# calculate users weight +# If user enters a planet number outisde of 1-7, print a message saying "Invalid planet number" + +# to calculate user weight on Mars: +# destination_weight = earth_weight * 0.38 + +# planet number variable + +#mercury = 1 +#venus = 2 +#mars = 3 +#jupiter = 4 +#saturn = 5 +#uranus = 6 +#neptune = 7 + +# planet Relative Gravity variable +#mercury_rg = 0.3 +#venus_rg = 0.91 +#mars_rg = 0.38 +#jupiter_rg = 2.53 +#saturn_rg = 1.07 +#uranus_rg = 0.89 +#neptune_rg = 1.14 + + +# to calculate user weight on Mars: +# destination_weight = earth_weight * 0.38 + +if planet_num ==1: + destination_weight = earth_weight * 0.38 +elif planet_num == 2: + destination_weight = earth_weight * 0.91 + print(destination_weight) +elif planet_num == 3: + destination_weight = earth_weight * 0.38 + print(destination_weight) +elif planet_num == 4: + destination_weight = earth_weight * 2.53 + print(destination_weight) +elif planet_num == 5: + destination_weight = earth_weight * 1.07 + print(destination_weight) +elif planet_num == 6: + destination_weight = earth_weight * 0.89 + print(destination_weight) +elif planet_num == 7: + destination_weight = earth_weight * 1.14 + print(destination_weight) +else: + print("Invalid planet number") From ad059b28b42488a3312c0cba4dd8401330fe637f Mon Sep 17 00:00:00 2001 From: Temitayo Adebisi Date: Wed, 20 Aug 2025 20:01:30 +0100 Subject: [PATCH 7/9] Rename planet-weight to planet-weight.py --- Self-project/{planet-weight => planet-weight.py} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename Self-project/{planet-weight => planet-weight.py} (100%) diff --git a/Self-project/planet-weight b/Self-project/planet-weight.py similarity index 100% rename from Self-project/planet-weight rename to Self-project/planet-weight.py From e9b7f56181a4830840983e799de27b2b888435d9 Mon Sep 17 00:00:00 2001 From: Temitayo Adebisi Date: Wed, 20 Aug 2025 20:05:54 +0100 Subject: [PATCH 8/9] Create sorting-hat.py --- Self-project/sorting-hat.py | 94 +++++++++++++++++++++++++++++++++++++ 1 file changed, 94 insertions(+) create mode 100644 Self-project/sorting-hat.py diff --git a/Self-project/sorting-hat.py b/Self-project/sorting-hat.py new file mode 100644 index 0000000..0790150 --- /dev/null +++ b/Self-project/sorting-hat.py @@ -0,0 +1,94 @@ +# The Sorting Hat project + +Gryffindor = 0 +Ravenclaw = 0 +Hufflepuff = 0 +Slytherin = 0 + +print("Q1) Do you like Dawn or Dusk?") +print (" 1) Dawn") +print (" 2) Dusk") + +Q1 = int(input(" Enter answer (1,2)")) + +if Q1 == 1: + Gryffindor = Gryffindor +1 + Ravenclaw = Ravenclaw +1 +elif Q1 == 2: + Hufflepuff = +1 + Slytherin = +1 +else: + print("Wrong input") + +#print(Gryffindor) +#print(Ravenclaw) +#print(Huffleclaw) +#print(Slytherin) +###### +print("==================================") + +print ("Q2) When I’m dead, I want people to remember me as:") +print ( "1) The Good") +print ( "2) The Great") +print ( "3) The Wise") +print ( "4) The Bold") +print("==================================") +Q2 = int(input(" Enter answer (1,2,3 and 4)")) + +if Q2 ==1: + Hufflepuff=Hufflepuff +2 +elif Q2 ==2: + Slytherin = Slytherin +2 +elif Q2 ==3: + Ravenclaw = Ravenclaw +2 +elif Q2 ==4: + Gryffindor = Gryffindor +2 +else: + print("Wrong input") + +######## +print("Q3) Which kind of instrument most pleases your ear?") +print ( "1) The violin") +print ( "2) The trumpet") +print ( "3) The piano") +print ( "4) The drum") +print("==================================") + +Q3 = int(input("Enter answer (1,2,3 and 4)")) + +if Q3 ==1: + Slytherin = Slytherin +4 +elif Q3 ==2: + Hufflepuff = Hufflepuff +4 +elif Q3 ==3: + Ravenclaw = Ravenclaw +4 +elif Q3 ==4: + Gryffindor = Gryffindor +4 +else: + print ("Wrong input") + +# Print out the score for each house +print("Slytherin:"+ str(Slytherin)) +print("Hufflepuff:" + str(Hufflepuff)) +print("Ravenclaw:" + str(Ravenclaw)) +print("Gryffindor:" + str(Gryffindor)) +print("==================================") + +# Figure out how to print out the house with the most points! + +if Slytherin >= Hufflepuff and Slytherin >= Gryffindor and Slytherin >= Ravenclaw: + print ("Slytherin! , the House with the most point") +elif Hufflepuff >= Gryffindor and Hufflepuff >= Ravenclaw and Hufflepuff>=Slytherin: + print ("Hufflepuff! ,the House with the most point") +elif Gryffindor >= Ravenclaw and Gryffindor >= Slytherin and Gryffindor>= Hufflepuff: + print("Gryffindor!, the House with the most point") + +else: + print ("Ravenclaw!, the House with the most point") + + + + + + + From 6772f8bd378cb33b3701e628b83c388b4852a829 Mon Sep 17 00:00:00 2001 From: Temitayo Adebisi Date: Wed, 20 Aug 2025 20:06:23 +0100 Subject: [PATCH 9/9] Delete 3-control-flow/sorting_hat.py --- 3-control-flow/sorting_hat.py | 95 ----------------------------------- 1 file changed, 95 deletions(-) delete mode 100644 3-control-flow/sorting_hat.py diff --git a/3-control-flow/sorting_hat.py b/3-control-flow/sorting_hat.py deleted file mode 100644 index 2633b63..0000000 --- a/3-control-flow/sorting_hat.py +++ /dev/null @@ -1,95 +0,0 @@ -# The Sorting Hat project - -Gryffindor = 0 -Ravenclaw = 0 -Hufflepuff = 0 -Slytherin = 0 - -print("Q1) Do you like Dawn or Dusk?") -print (" 1) Dawn") -print (" 2) Dusk") - -Q1 = int(input(" Enter answer (1,2)")) - -if Q1 == 1: - Gryffindor = Gryffindor +1 - Ravenclaw = Ravenclaw +1 -elif Q1 == 2: - Hufflepuff = +1 - Slytherin = +1 -else: - print("Wrong input") - -#print(Gryffindor) -#print(Ravenclaw) -#print(Huffleclaw) -#print(Slytherin) -###### -print("==================================") - -print ("Q2) When I’m dead, I want people to remember me as:") -print ( "1) The Good") -print ( "2) The Great") -print ( "3) The Wise") -print ( "4) The Bold") -print("==================================") -Q2 = int(input(" Enter answer (1,2,3 and 4)")) - -if Q2 ==1: - Hufflepuff=Hufflepuff +2 -elif Q2 ==2: - Slytherin = Slytherin +2 -elif Q2 ==3: - Ravenclaw = Ravenclaw +2 -elif Q2 ==4: - Gryffindor = Gryffindor +2 -else: - print("Wrong input") - -######## -print("Q3) Which kind of instrument most pleases your ear?") -print ( "1) The violin") -print ( "2) The trumpet") -print ( "3) The piano") -print ( "4) The drum") -print("==================================") - -Q3 = int(input("Enter answer (1,2,3 and 4)")) - -if Q3 ==1: - Slytherin = Slytherin +4 -elif Q3 ==2: - Hufflepuff = Hufflepuff +4 -elif Q3 ==3: - Ravenclaw = Ravenclaw +4 -elif Q3 ==4: - Gryffindor = Gryffindor +4 -else: - print ("Wrong input") - -# Print out the score for each house -print("Slytherin:"+ str(Slytherin)) -print("Hufflepuff:" + str(Hufflepuff)) -print("Ravenclaw:" + str(Ravenclaw)) -print("Gryffindor:" + str(Gryffindor)) -print("==================================") - -# Figure out how to print out the house with the most points! - -if Slytherin >= Hufflepuff and Slytherin >= Gryffindor and Slytherin >= Ravenclaw: - print ("Slytherin! , the House with the most point") -elif Hufflepuff >= Gryffindor and Hufflepuff >= Ravenclaw and Hufflepuff>=Slytherin: - print ("Hufflepuff! ,the House with the most point") -elif Gryffindor >= Ravenclaw and Gryffindor >= Slytherin and Gryffindor>= Hufflepuff: - print("Gryffindor!, the House with the most point") - -else: - print ("Ravenclaw!, the House with the most point") - - - - - - - -