5. Pull It All Together



I'm getting this error: Oops, try again. trip_cost('Los Angeles', 5) returned None instead of the correct value 1355. This error will jump from city to day and keep giving me the same error...sometimes it says "False" where it shows "None"

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
        return "Enter City Again"

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


You forgot to return your trip_cost function.


On the very last line

replace trip_cost = because the equation you've created will produce that already
And remember to return your answer


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.