Plan Your Trip! Nothing printed?


#1

def hotel_cost(days):
    return 140 * days

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

    maincost = days * 40
    
    if (days >= 3 and days < 7):
        maincost -= 20
    elif (days >= 7):
        maincost -= 50

    return maincost

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 Angeles', 5, 600)

I thought this was right but it says nothing is being printed :confused:

`


#2

the function call should be outside the function body:

def trip_cost(city, days, spending_money):
    # function body
    return hotel_cost(days) + plane_ride_cost(city) + rental_car_cost(days) + spending_money
    # function call, place it outside the function by changing indent
    print trip_cost('Los Angeles', 5, 600)

#3

Ah, thanks. Still getting used to the indentation.


#4