Python's syntax is simple--in the form of indentation
There are advantages and disadvantages of indentation:
One of the benefits is forcing you to write formatted code, but it doesn't specify whether the indentation is a few spaces or tab. In accordance with established management, you should always stick to the indentation of 4 spaces.
The second is to force you to write less indented code, and you will tend to split a very long code into several functions , resulting in less code being indented.
The downside of indentation is that the "copy-paste" function fails, which is the most pit-daddy place. When you refactor the code , the pasted past code must re-check that the indentation is correct. In addition, it is difficult for the IDE to format Python code just like formatted Java code.
In addition, in the text editor, you need to set the tab to automatically convert to 4 spaces, ensuring that tab and space are not mixed.
Reference: Liaoche Teacher's Blog
Python indentation syntax, pros and cons