diff --git a/Self-project/planet-weight.py b/Self-project/planet-weight.py new file mode 100644 index 0000000..93c568a --- /dev/null +++ b/Self-project/planet-weight.py @@ -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") 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 @@ + 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") + + + + + + +