#7 plan your trip


def hotel_cost(nights):
    return 140 * nights
def plane_ride_cost(city):
    if city == "Los Alenges":
        return 475
    elif city == "Tampa":
        return 220
    elif city == "Charlotte":
        return 183
    elif city == "Pittsburgh":
        return 222
        return 475
def rental_car_cost(days):
    cost = 40 * days
    if days >= 7:
       cost = cost - 50
    elif days >= 3:
         cost = cost - 20
    return cost  
    nights == days    
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)

#7 Plan Trip cant print out final code on to console

same answer, you hijack a topic rather then making a new topic (see guidelines), and you don't give any acknowledgement to my answer, what do you not understand about it?


Forgive me for that and thanks for helping


:pensive:Help again please. I still don't get it.


Don't get what? Please a bit more specific. Explain what you do understand so i can fill in the blanks


4 posts were split to a new topic: Plan your trip


You gave me a hint to indent.What should I indent


i said the answer has to do with indent

well, the function call executes the function, so the function call should be placed outside the function. Python uses indent to determine what is nested inside the function

so in your case, you want to place something outside the function, so you will need to have an indent of 0 spaces

I said the issue had to do with indent, this works both ways (un-indent included)


def trip_cost(city, days, spending_money):

Only 2 arguments are taken! not 3


print trip_cost(______)


   print trip_cost(________)


Global call, not a local call of the functions.