Splitting Strings With The Partition Method
Splitting Strings With The Partition Method
split('ABC')
['My', 'name', 'is', 'Simon']
>>> 'My name is Simon'.split('m')
['My na', 'e is Si', 'on']
Passing split() the argument '\n' lets us split the multiline string
stored in spam along the newlines and return a list in which each item
corresponds to one line of the string.