-
Notifications
You must be signed in to change notification settings - Fork 0
/
rollercoaster.py
32 lines (28 loc) · 974 Bytes
/
rollercoaster.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
print("Welcome to the rollercoaster!")
height = int(input("What is your height in cm? \n"))
child_ticket = 5
youth_ticket = 7
adult_ticket = 12
total_price = 0
if height > 120:
print("You can ride the rollercoaster!")
age= int(input("What is your age ? "))
if age < 12:
print(f"Child ticket price is ${child_ticket}.")
total_price = child_ticket
elif age <= 18:
print(f"Youth ticket price is ${youth_ticket}.")
total_price = youth_ticket
elif age >= 45 and age <=55:
total_price = 0
else:
print(f"Adult ticket price is ${adult_ticket}.")
total_price = adult_ticket
ask_photo = input("Would you like a photo? (yes/no) \n")
if ask_photo == "yes":
total_price += 3
print(f"Ok, the total price is ${total_price}.")
else:
print(f"Ok, the total price is ${total_price}.")
else:
print("Sorry, you have to grow taller before you can ride.")