Taking a Vacation: Indentation Error


#1

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):
cost = 40*days
if days >= 7:
return cost -= 50
elif days >= 3:
return cost -= 20
elif days > 0:
return cost
def trip_cost(city,days):
return hotel_cost(nights) + plane_ride_cost(city) + rental_car_cost(days)

can you please tell me where i am doing things wrong. help will be appriciated
error showing is
File "python", line 14
if days >= 7:
^
IndentationError: unindent does not match any outer indentation level


Yoohoo! can anyone help me! something is wrong with my code!
#2

@gaurav0503 ,

You have an IndentationError. However, we cannot see the indentation of your code, since it is not formatted.

Please format code when you post it, so that we can help.

See How do I format code in my posts?.


#3

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