Python uses indentation to organize code blocks, convention habit

Python uses indentation to organize code blocks, be sure to follow the customary, stick with the four spaces of indentation.

In a text editor, you need to set the Tab automatically converted into four spaces, and spaces to ensure that no mix Tab.

Another benefit is the indentation force you to write less code indentation, you will tend to split a long code into several functions, resulting in less code indentation.

Indent downside is "copy - paste" function failure, and this is where most pit father. When you refactor the code, paste the code must re-examine the past indentation is correct. In addition, IDE Java code as difficult as formatted formatted coupon website Python code.

Guess you like

Origin www.cnblogs.com/C2020/p/12119118.html