Not Working HELP


#1




Oops, try again. It looks like nothing was printed to the console!


Print out the trip cost to Los Angeles for 5 days with 600 extra spending money, but not working.


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):
    cost = days*40
    if days >= 7:
       return cost - 50
    elif 7 > days >= 3:
       return cost - 20
    return cost
    
def trip_cost(city, days, spending_money):
    return rental_car_cost(days) + hotel_cost(days) + plane_ride_cost(city) + spending_money
    print trip_cost("Log Angeles", 5, 600)


#2

the function call should be outside/after the function, you currently nest the function call inside the function


#3

do you mean the code

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

if so, I took out that code and ran it like this:

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 = days*40
    if days >= 7:
       return cost - 50
    elif 7 > days >= 3:
       return cost - 20
    return cost
      
def trip_cost(city, days, spending_money):
    return rental_car_cost(days) + hotel_cost(days) + plane_ride_cost(city) + spending_money
      
print trip_cost("Log Angeles", 5, 600)

but comes out as

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


#4

Log Angeles? I know a city called Los Angeles, but Log Angeles is new for me


#5

OH SHOOT stupid me. thanks for the correction


#6