WhiteSpace Question


So while doing the Python lesson 6/13, they started talking about white-spaces. I understand what they are but Codecademy said you can either indent them twice or four times, but they indent it twice for visual purposes, also they said you have to be consistent with how you indent it. Does this mean I can indent it twice in the actual Python program but I have to indent a line twice every singe time, or can I switch around (between 2 and 4 indents). Also is it not possible to indent the lines three times, also can i indent a line with more than four spaces?


Replace this line with your code.

<do not remove the three backticks above>


well, you could do this:

if condition:
    print True
elif another condition:
         print False

which is not consistent (4 spaces vs 8 spaces)

you can choices how many spaces/tabs you like, but be consistent. But 4 spaces is by far the most common.

see this pep:


Ohhh thanks, so as long as the space is a even number?


this can be even or odd/uneven, but uneven/odd is really uncommon


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.