Plan your Trip!


#1



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 days >= 3:
        return cost - 20
    else:
        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("Los Angeles", 5, 600)```

Oops, try again. Your code looks a bit off. Check the Hint if you need help!`


Replace this line with your code.


#2

see the error in the console?
this line:

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

the function call should be outisde the function, hint: indention


#3
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 days >= 3:
        return cost - 20
    else:
        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("Los Angeles", 5, 600)

Like this? same error occurs


#4

no, like this:

def example():
   return "do something"
print example()

that function calls should be intended in such a way that they are not inside the function itself, shouldn't be new


#5

MAAAANNNNN!!! Thanx Alot Man.. You're Genius


#6