The .split() method splits a string into a list.
If you give it an argument, telling it the separator you want to split on, then
it will split on that separator.
If you give it no argument, then it will split, in a special way, on all
"white-space" characters. White-space characters are the SPACE, TAB and
NEWLINE characters, namely " " and "\t" and "\n" respectively. The special way
means that any sequence of white-space characters is considered a single
white-space character: in other words, it collapsed all spaces, etc. into one
space between words.
The .join() method takes a list and concatenates the elements of that list into a single string, using the separator string you give it. See below for examples:
>>> A = " Now is
the time. For what? "
>>> B = A.split()
>>> print(B)
['Now', 'is', 'the', 'time.', 'For', 'what?']
>>> " ".join(B)
'Now is the time. For what?'
>>> "+-".join(B)
'Now+-is+-the+-time.+-For+-what?'
>>> "".join(B)
'Nowisthetime.Forwhat?'
>>> C = "are,you,there"
>>> C.split(",")
['are', 'you', 'there']
>>> D = "a tots for toots"
>>> D.split("t")
['a ', 'o', 's for ', 'oo', 's']
>>> E = '''
one
word
per
line
'''
>>> F = E.split()
>>> F
['one', 'word', 'per', 'line']
>>> print(",\n\n".join(F))
one,
word,
per,
line
>>>