
上QQ阅读APP看书,第一时间看更新
Indentation
If you come from a background of a language such as Java, C, or C++, you might be familiar with the concept of grouping logically connected statements using curly braces. This is not the case, however, in Python. Instead, the logically connected statements, including classes, functions, conditional statements, and loops, are grouped using indentation. Indentation keeps the code clean and easy to read. We shall explore this in more detail in the coming sections. For now, however, let's say goodbye to braces. I recommend that you use tabs for indentation, as typing an equal number of spaces in every line becomes very time-consuming.