Skip to content Skip to sidebar Skip to footer

How To Fix A TabError

I have no idea why it keeps saying TabError: inconsistent use of tabs and spaces in indentation At the line counter = 0 If I remove 'counter = 0', it works. if counter < 3:

Solution 1:

You must use either all spaces or all tabs for your indentation, as the error message says.

Tabs and spaces, or using tabs at all for indentation, is considered bad practice in Python.

You would probably benefit from a good text editor or IDE that will show the difference between tabs and spaces, and automatically insert spaces for you while you code.


Post a Comment for "How To Fix A TabError"