Plan your trip!


#1



When I click submit, I get an error message saying "Oops, try again. It looks like nothing was printed to the console!"

I have no idea what im doing wrong before I added in "Los Angeles," 5 , 600), my code was right.


def trip_cost (city, days, spending_money):
    return hotel_cost(days) + rental_car_cost(days) + plane_ride_cost (city) + spending_money
    return trip_cost
    print trip_cost("Los Angeles", 5, 600)


#2

HI first remove this line

return trip_cost

then this line shouldn't be indent

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

#3

thankyou it works! But i dont understand why the return trip_cost line was removed and print wasn't an indent because it usually is?
Thankyou so much though!


#4

Because you already have a return statement, the second return statement (return trip_cost) is never reached.
After a return statement the rest of the function is not read, no matter how much code there is after, python doesn't read any further and returns the values defined after the return statement.

The print statement shouldn't be indent because it then is inside of your function. This could work too, but not if your return statement is before the print statement.
However, this is not what we want from this function, so keep the print statement outside of the function and you should be good.