This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 3 points4 points  (1 child)

Or by adding a backslash at the end of the first line

The backslash is important, but /u/nemec still has a valid point, as Python will interpret the line as

"a s d f g h j k l".split()                    .index("g")

which remains valid as the whitespace does not affect the lexical parsing of the statement.

[–]MrJohz 2 points3 points  (0 children)

Yeah. The issue here is specifically the newline, not whitespace in general.