5. pull it together


#1

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

When I put this in I get: trip_cost('Charlotte', 4) raised an error: unsupported operand type(s) for +: 'function' and 'int'


#2

You need an argument in your rental_car_cost call, like so. rental_car_cost(days) rather than simply rental_car_cost


#3

Ahh it works thank you!