Pull it together


Why do I get this error?

5/7 Pull it together (Taking a Vocation)

Hi @jnsahil101,

The message suggests that there may be a problem with your trip_cost function. However, the illustration that you posted does not display the code for that function, therefore we cannot diagnose the problem.

You can post another illustration that includes the omitted code, or, even better, post the actual code as text, so that we can copy and test it.


Again, I'm struggling with this indentation stuff and don't understand why. What's the rule of thumb? Why doesn't Codeacademy's editor auto-indent like other editors?
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):
return 40 * days
if days >= 7:
return 40 * days - 50
elif days >= 3:
return 40 * days - 20
def trip_cost (city, days):
def add( city, days):
return plane_ride_cost(city) + hotel_cost(nights)


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.