If I have a line, I can break it around a space using the str.split method:
"hello world!".split()
returns
['hello', 'world!']
If I have a list like
['hey', 1, None, 2.0, 'string', 'another string', None, 3.0]
Is there a separation method that will break into None and give me
[['hey', 1], [2.0, 'string', 'another string'], [3.0]]
If there is no built-in method, what would be the most Pythonic / elegant way to do this?
source share