Tabs and Indents
Function or procedure call
Use tab character
Use TAB characters instead of SPACE characters for indents. A TAB character appears when you press Tab. A SPACE character when you press Space.
Use combination of TAB and SPACE characters depending on the context.
Set the size of a single TAB character (in a number of SPACE characters).
Set the size of an indent (in a number of SPACE characters). Indent is a position of a text relative to the margin. In our case, the margin is a gutter with line numbers.
Add a number of SPACE characters to an indent on a next line for a multiline expression. Consider the following example with zero indent and aligned strings.
Keep indents on empty lines
Keep indents if the line is empty.
Refer to Reformat and rearrange code for more details on auto-formatting code in PyCharm.