Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def aquariumTicket(total=0):
- adult_price = 26.00
- child_price = 19.50
- senior_price = 21.50
- baby_price = 0.00
- age = input("What is your age? ")
- if age < 3:
- print "Ticket price: $%.2f" % baby_price
- return aquariumTicket(total + baby_price)
- elif age <= 12 and age >= 3:
- print "Ticket price: $%.2f" % child_price
- return aquariumTicket(total + child_price)
- elif age > 12 and age < 55:
- print "Ticket price: $%.2f" % adult_price
- return aquariumTicket(total + adult_price)
- elif age >= 55:
- print "Ticket price: $%.2f" % senior_price
- return aquariumTicket(total + senior_price)
Add Comment
Please, Sign In to add comment