Taking a Vacation



I know the trip_cost function is supposed to have only two arguments, but if hotel_cost takes the argument 'nights' and rental_car_cost takes the argument 'days' , which are two separate arguments, why is it asking for only two arguments? I can get it to run but it still says it's incorrect...

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):
    total= 40*days
    if days>=7:
    elif days>=3:
    return total
def trip_cost(city,nights,days):
    return hotel_cost(nights)+rental_car_cost(days)+plane_ride_cost(city)
print trip_cost('Tampa',5,3)


It only needs two pieces of information, aka, data, days and city so there are only two arguments in the function call.

Take out the nights parameter.


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