# 5/7 taking a vacation

#1

So far i have the following code:-
def hotel_cost(nights):
return 140 * nights

def plane_ride_cost(city):
if city == "Charlotte":
return 183
if city == "Tampa":
return 220
if city == "Pittsburgh":
return 222
if city == "Los Angeles":
return 475
def rental_car_cost(days):
cost = 40 * days
if days >= 7:
return cost - 50
elif days >= 3:
return cost - 20
else:
return cost
def trip_cost(days,city):
return rental_car_cost(days) + hotel_cost(days) + plane_ride_cost(city)

#2
``````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):
rental_car_cost = 40 * days
if days >= 7:
rental_car_cost -= 50
elif days >= 3:
rental_car_cost -=20

``return rental_car_cost``

def hotel_cost(days):
return 140 * days

def trip_cost(city, days):
return rental_car_cost(days) + hotel_cost(days) + plane_ride_cost(city)

#3

(post withdrawn by author, will be automatically deleted in 24 hours unless flagged)

#5

def hotel_cost(nights):
return 140*nights
def rental_car_cost(days):
cost =40*days
if days >=7:
cost -=50
elif days >=3 and days < 7:
cost -=20
return cost
def trip_cost(city,nights, spending_money):
if city == "Charlotte":
return (183 + hotel_cost(nights) + rental_car_cost(nights)+spending_money)
if city == "Tampa":
return 220 + hotel_cost(nights) + rental_car_cost(nights) + spending_money
if city == "Pittsburgh":
return (222 + hotel_cost(nights) + rental_car_cost(nights) + spending_money)
if city == "Los Angeles":
return 475 + hotel_cost(nights) + rental_car_cost(nights) + spending_money