Guest User

Untitled

a guest
Nov 25th, 2017
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. def aquariumTicket(total=0):
  2. adult_price = 26.00
  3. child_price = 19.50
  4. senior_price = 21.50
  5. baby_price = 0.00
  6. age = input("What is your age? ")
  7. if age < 3:
  8. print "Ticket price: $%.2f" % baby_price
  9. return aquariumTicket(total + baby_price)
  10. elif age <= 12 and age >= 3:
  11. print "Ticket price: $%.2f" % child_price
  12. return aquariumTicket(total + child_price)
  13. elif age > 12 and age < 55:
  14. print "Ticket price: $%.2f" % adult_price
  15. return aquariumTicket(total + adult_price)
  16. elif age >= 55:
  17. print "Ticket price: $%.2f" % senior_price
  18. return aquariumTicket(total + senior_price)
Add Comment
Please, Sign In to add comment