It seems to be ignored inside a list, for example:
for x in range(5):
list += [x, 1
,2,3,
4,5]
It seems to be ignored inside a list, for example:
for x in range(5):
list += [x, 1
,2,3,
4,5]
White-space is only important for indentation of statements, what you have is a single statement across several lines, only the indentation of the beginning of the statement on the first line is significant, see this for more info.
Your question is really about when Python implicitly joins lines of code.
Python will implicitly join lines that are contained within (parentheses), {braces}, and [brackets], as in your example code. You can also explicitly join lines with a backslash (\) at the end of a line.
More here on implicit line continuation:
Mr. Gamble's answer is correct for indentation.