Please I need help on this


#1

Please I need help on this

def hotel_cost(nights) :
    # if the hotel cost $140/day
    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:
        cost-=50
        return cost
    elif days >=3:
        cost-=20
        return cost
    else:
        return cost
def trip_cost(days,city):
    return hotel_cost(days)+plane_ride_cost(city)+rental_car_cost(days)
    print trip_cost(7,"Tampa")

Hey, You Never Know! what?
#4

Unindent the last line,

print trip_cost("Tampa",7)

and reverse the order of parameters,

def trip_cost(city, days):

#5

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