Taking a Vacation - Transportation (IndentationError)


The error message says:

File "python", line 15
if days >= 7:
IndentationError: unindent does not match any outer indentation level

I really don't know what's wrong with the code since, it doesn't give clear indication of where I was wrong.


def rental_car_cost(days):
        cost = days * 40
    if days >= 7:
        cost -= 50
    elif days >= 3:
        cost -= 20
    return cost


Look here:

Look at the error:

That means cost = days * 40 should be on the same level as the rest of your code. The error kind of hints what you should do to fix this...

It should be on the same level as your if/elif statements...


I got it now! Thank you soo much :slight_smile:


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