Plan a trip


#1


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
    else:
        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)


#2

Spelling error. plane_ride_cost() is returning None.


#3

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


#4

How is "Los Angeles" spelled in your function?


#5

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