7/8 Where did I go wrong?


#1

I cant find the correct solution:
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):
rental_car_cost = 40 * days
if days >= 7:
rental_car_cost -= 50
elif days >= 3:
rental_car_cost -=20

return rental_car_cost

def hotel_cost(days):
return 140 * days

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)

Im willing to take any advice on this


#2

The problem in your code maybe the misuse of TAB. Because there is no indicator of when the function ends like JavaScript, it is important to do the TAB correctly, which is Python's indicator of when a function ends, if the function is in the function, etc. Anyways, check your TAB, for there may be something wrong with it.


#3

Just backspace the print line and make it start on the same row with you def