Advertisement
JkSoftware

Day 3 - Multiple if Statements

Nov 5th, 2021
941
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. height = int(input("What is your height in cm? "))
  2. bill = 0
  3. if height >= 120:
  4.     print("You may ride the rollercoaster")
  5.     age = int(input("What is your age?"))
  6.     if age < 12:
  7.         print("Child tickets are $5")
  8.         bill = 5
  9.     elif age <= 18:
  10.         print("Youth tickets are $7")
  11.         bill = 7
  12.     else:
  13.         print("Adult tickets are $12")
  14.         bill = 12
  15.  
  16.     wants_photo = input("Would you like a photo taken? Y or N")
  17.     if wants_photo == "Y":
  18.         bill += 3
  19.  
  20.     print(f"Your total bill is ${bill}")
  21.    
  22.  
  23. else:
  24.     print("Sorry, you have to grow taller before you can ride")
Advertisement
Advertisement
Advertisement
RAW Paste Data Copied
Advertisement