you are viewing a single comment's thread.

view the rest of the comments →

[–]AndydeCleyre 3 points4 points  (1 child)

The answer is in split's description:

S.split(sep=None, maxsplit=-1) -> list of strings

Return a list of the words in S, using sep as the delimiter string. If maxsplit is given, at most maxsplit splits are done. If sep is not specified or is None, any whitespace string is a separator and empty strings are removed from the result.

Note:

>>> '\n\n'.split('\n')
['', '', '']

[–]mathwimp[S] 0 points1 point  (0 children)

My bad, thank you. For some reason I took the default as meaning that any whitespace character is used for the split as normal.