Pull It Together: Weird Indentation error


#1



This is my code:

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

It is giving me error :File "python", line 22
def trip_cost(city, days):
^
IndentationError: unindent does not match any outer indentation level

I personally don't see any indentation error, please help.



#2

please format your code properly

read this


#9

you have a space in front of the def keyword, which counts as indent, remove the space


#10

Thank you! Finally,was giving me a headache, it's funny how something so little can mess up your code. Cheers.


#11