Taking a Vacation



it calls me to calculate the result of trip_cost, by adding a a third argument. but I don't know how to def the argument. Who can kindly tell me how to do it? thanks a lot!

def rental_car_cost(days):
    if days>=7:
        costs -=50
    elif days>=3:
        costs -=20
    return costs
def hotel_cost(days):
    return days*140

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 trip_cost(city,days,spengding_money):
    return rental_car_cost(days) + hotel_cost(days) + plane_ride_cost(city)




You misspelled.
Its spending_money


return rental_car_cost(days) + hotel_cost(days) + plane_ride_cost(city)

You forgot to add this extra money (spending_money) to final sum?


jajaja, thanks a lot.


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