5. Pull it Together


#1

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

This is the error im getting:

Oops, try again.
rental_car_cost(1) returned None instead of the correct value 40

#2

Hi try to put days in hotel_cost(here)


#3

That didnt work, it seems like the rental car cost is causing the error.


#4

In your code try to replace all the rental_car_cost by any other name you like....in the first case

car = 40 * days