7.06 You Never Know!


#1


7.6 Hey You Never Know!

Hello to all who can help me before you say anything yes I'm a n00b. Anyway I keep getting this error message: trip_cost('Los Angeles', 0, 0) returned instead of the correct value 475. Any advice?

please not this may not be the final version and I have tried multiple times with different configurations. Thanks! ^U^


ef 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):
    cost = 40 * days
    if (days >= 7):
        return cost - 50
    elif(days >= 3):
        return cost - 20
    else:
        return cost

def trip_cost(city, days, spending_money):
    hotel_cost(days) + plane_ride_cost(city) + rental_car_cost(days) + spending_money   
    return trip_cost
    print trip_cost ("Tampa", 600, 5)


#2

HI this part

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

instead of returning the function trip_cost you should return hotel_cost(days) + plane_ride_cost(city) + rental_car_cost(days) + spending_money and remove the return trip_cost

and this line

print trip_cost ("Tampa", 600, 5)

You don't need to indent it.


#3

Danke Schon (thank you!!!)