Plan a trip


Traceback (most recent call last):
File "python", line 23, in
File "python", line 21, in trip_cost
TypeError: unsupported operand type(s) for +: 'int' and 'NoneType'

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:
        return total-50
    elif days>=3:
        return total-20
        return total
def trip_cost(city, days, spending_money):
    return hotel_cost(days)+ plane_ride_cost(city)+ rental_car_cost(days)+spending_money
print trip_cost("Los Angles", 5, 600)


Spelling error. plane_ride_cost() is returning None.


there is no spelling error i think !!
i'm having the same problem


How is "Los Angeles" spelled in your function?


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