Answer the question
In order to leave comments, you need to log in
How to avoid TabError in Python?
Good day, toasters, tell me, please, mb someone has already encountered such a problem. The problem is that I write Python code, save the file, close it. Then I open it again, start writing code, and it starts giving me a TabError error
Answer the question
In order to leave comments, you need to log in
1. Read the error first.
2. Put an editor that can show tabs and spaces with different characters
3. Make sure that you either have only tabs or only spaces. Better, of course, only spaces, because PEP8
4. Do not ask stupid questions, the answers to which are in Google for as many as 10 relevant pages
TabError says that indentations from both tabs and spaces are mixed up in the code.
Decide what style of indentation to use and bring the code to uniformity. (According to PEP8, 4 spaces are preferred).
Also make sure that the indentations are correct, as this is critical in Python.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question