Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- height = int(input("What is your height in cm? "))
- bill = 0
- if height >= 120:
- print("You may ride the rollercoaster")
- age = int(input("What is your age?"))
- if age < 12:
- print("Child tickets are $5")
- bill += 5
- elif age <= 18:
- print("Youth tickets are $7")
- bill += 7
- elif age >= 45 and age <= 55: # and logical operator
- print("You are in midlife crises, maybe this free ride will help")
- else:
- print("Adult tickets are $12")
- bill += 12
- wants_photo = input("Would you like a photo taken? Y or N")
- if wants_photo == "Y":
- bill += 3
- print(f"Your total bill is ${bill}")
- else:
- print("Sorry, you have to grow taller before you can ride")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement