Unsupported operand type(s) for +: 'NoneType' and 'int' Exercise 7


#1

@joferzed @gaurangtandon

def hotel_cost(nights):
    return 140*nights
def plane_ride_cost(city):
    
    if city.lower() == "tampa":
        return 220 
    elif city.lower() == "charlotte":
        return 183
    elif city.lower()== "pittsburgh":
        return 222
    elif city.lower() == "los Angeles":
        return 474
  
def rental_car_cost(days):
    if days>=7:
        cost=(days*40)-50
        return cost
    elif days>=3:
        cost=(days*40)-20
        return cost
    else:
        cost=days*40
        return cost

def trip_cost(city, days, spending_money):
    a=rental_car_cost(int(days))
    b=plane_ride_cost(city)
    c=int(spending_money)
    d=hotel_cost(int(days))
    return b+a+d+c

print trip_cost("Los Angeles", 5, 600)

i am getting error:

Traceback (most recent call last):
  File "python", line 32, in <module>
  File "python", line 30, in trip_cost
TypeError: unsupported operand type(s) for +: 'NoneType' and 'int'

please help me solve this!
thanx


7. Plan your trip
#2

Hi @tagninja09663,

In this line:

elif city.lower() == "los Angeles":

the capital "A" is causing you trouble. Do you know why?