Skip to content

Instantly share code, notes, and snippets.

@AliOsm
Created December 18, 2015 17:05
Show Gist options
  • Save AliOsm/e408203403188ccb8f71 to your computer and use it in GitHub Desktop.
Save AliOsm/e408203403188ccb8f71 to your computer and use it in GitHub Desktop.
def hotel_cost (nights) :
return 140*nights
def plane_ride_cost (city):
if city=="Charlotte" :
return 183
elif city=="Tampa" :
return 220
elif city=="Pittsburgh" :
return 222
elif city=="Los Angeles" :
return 475
def rental_car_cost(days):
if days>=7:
return days*40-50
elif days>=3 and days<7 :
return days*40-20
else :
return days*40
def trip_cost(city,days,spending_money):
return rental_car_cost(days)+hotel_cost(days)+plane_ride_cost(city)+spending_money
print trip_cost("Los Angeles",5,600)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment