#7 plan your trip


#1

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
    else:
        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
#2

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?


#3

Forgive me for that and thanks for helping


#4

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


#5

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


#7

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


#11

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


#12

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)


#13

def trip_cost(city, days, spending_money):

Only 2 arguments are taken! not 3


#14

print trip_cost(______)

Not

   print trip_cost(________)

#15

Global call, not a local call of the functions.


#16