Next / Previous / Contents / TCC Help System / NM Tech homepage

6.3. A word about indenting your code

One of the most striking innovations of Python is the use of indentation to show the structure of the blocks of code, as in the if statement. Not everyone is thrilled by this feature. However, it is generally good practice to indent subsidiary clauses; it makes the code more readable. Those who argue that they should be allowed to violate this indenting practice are, in the author's opinion, arguing against what is generally regarded as a good practice.

The amount by which you indent each level is a matter of personal preference. You can use a tab character for each level of indention; tab stops are assumed to be every 8th character. Beware mixing tabs with spaces, however; the resulting errors can be difficult to diagnose.