Inconsistent use of tabs and spaces in indentation and other problems

When writing Python programs, you encounter errors related to tabs and indentation.

Some interpreters distinguish between four spaces and one tab. Sometimes the code downloaded from Git often has such a mismatch problem.

Just like this
Write picture description here
, the indentation of the first and third lines is done by four spaces, and the second line is a tab, which is not visible at first glance, but when something goes wrong, it is very difficult to change one by one. Trouble, so we can set it like this in Notepad++:
View-display symbols-display spaces and tabs
Write picture description here

In this way, it is clear whether the indentation is four spaces or one tab.
Write picture description here

Guess you like

Origin blog.csdn.net/mid_Faker/article/details/109471902