+ 8
You pick the indentation in the first line you apply it to. You have to stay consistent throughout the code, that is if you choose to indent 2, 3 or 4 spaces, you have to preserve the same indentation step along (so 2, 4, 6... spaces, 3, 6, 9 or 4, 8, 12... respectively). By convention - the standard is 4. As for "when" - think of your code as composed of blocks. Each block having a different logic, like loop or an "if" condition has to be indented. A good explanation on indentation is here in the Sololearn Python course :)
2nd Jun 2017, 3:26 PM
Kuba SiekierzyƄski
Kuba SiekierzyƄski - avatar