What\'s the best way to slice the last word from a block of text?
I can think of
If you want to keep your current method, use ' '.join(words) to concatenate the list.
' '.join(words)
You also might want to replace words = words[len[words -1] with words = words[:-1] to make use of list slicing.
words = words[len[words -1]
words = words[:-1]