Pull it Together..8/5


#1

def hotel_cost(night):
return 140 * night
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):
cost = 40 * days
if days >= 7:
cost = cost - 50
elif days >= 3:
cost = cost - 20
return cost
def trip_cost(city, days):
city = "Tampa"
night = 5
days = night
return hotel_cost(night) + plane_ride_cost(city) + rental_car_cost(days)

Oops, try again.
trip_cost('Tampa', 9) returned 1100 instead of the correct value 1790
I am really stuck please help :frowning:


#2

remove

city = "Tampa"
night = 5
days = night

if you want to give arguments to your function, call it and give arguments to it

print function(argument1, argument2)


#3

thank you very much, now I understood