Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #1
- def program1():
- first = input("First Name: ")
- sur = input("Sur Name: ")
- for i in range(3):
- print(first, sur)
- #2
- def program2():
- num1 = int(input("Num1 = "))
- num2 = int(input("Num2 = "))
- num3 = int(input("Num3 = "))
- result = (num1+num2) * num3
- print(num1, "+", num2, "", num3, "=", result)
- #3
- def program3():
- numdays = int(input("Number of days: "))
- numhrs = numdays * 24
- nummins = numhrs * 60
- numsecs = nummins * 60
- print(numhrs,nummins,numsecs)
- #4
- def program4():
- w = int(input("Width = "))
- l = int(input("Length = "))
- d = int(input("Depth = "))
- m3 = w * l * d
- print("The swimming pool has a volume of", m3, "cubic meter(s)")
- #5
- def program5():
- question = input("What is your question?\n")
- print("Let me think about that.. I don't want to answer that question right now")
- print(question)
- input()
- print("I thought so")
- #6
- def program6():
- hrswork = int(input("How many hours did you work?: "))
- payperhr = float(input("How much are you paid per hour?: "))
- payment = hrswork * payperhr
- print("you have earned",payment)
- #7
- def program7():
- onepence = int(input("how many Pennys?: "))
- twopence = int(input("how many Two Pence?: "))
- fivepence = int(input("how many Five Pence?: "))
- tenpence = int(input("how many Ten Pence?: "))
- twentypence = int(input("how many Twenty Pence?: "))
- fiftypence = int(input("how many Fifty Pence?: "))
- onepound = int(input("how many Pounds?: "))
- twopound = int(input("how many Two Pounds?: "))
- onepencecal = onepence * 0.01
- twopencecal = twopence * 0.02
- fivepencecal = fivepence * 0.05
- tenpencecal = tenpence * 0.10
- twentypencecal = twentypence * 0.20
- fiftypencecal = fiftypence * 0.50
- onepoundcal = onepound * 1
- twopoundcal = twopound * 2
- totalpiggy = onepencecal + twopencecal + fivepencecal + tenpencecal + twentypencecal + fiftypencecal + onepoundcal + twopoundcal
- print("Total Value of the piggy bank is",totalpiggy)
- selection = input("Enter the question number of program you want to run? (1-7) ")
- if selection == ("1"):
- program1()
- if selection == ("2"):
- program2()
- if selection == ("3"):
- program3()
- if selection == ("4"):
- program4()
- if selection == ("5"):
- program5()
- if selection == ("6"):
- program6()
- if selection == ("7"):
- program7()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement