Advertisement
Guest User

Untitled

a guest
Jul 22nd, 2017
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1. #Trip cost
  2. def hotel_cost(nights):
  3. return 80*nights
  4.  
  5. def plane_ride_cost(city):
  6. if city == "Athens":
  7. return 55
  8. elif city == "NY":
  9. return 520
  10. elif city == "Los Angeles":
  11. return 452
  12. elif city == "Paris":
  13. return 275
  14.  
  15. def rental_car_cost(days):
  16. cost = days*40
  17. if days >= 7:
  18. cost = cost - 50
  19. elif days >= 3:
  20. cost = cost - 20
  21. return cost
  22.  
  23. def trip_cost(city,days,spending_money):
  24. return rental_car_cost(days) + hotel_cost(days) + plane_ride_cost(city)+spending_money
  25.  
  26.  
  27. total_cost=trip_cost("Athens",10,1000)
  28. print ("Total cost of the trip will be:", total_cost)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement