I'd like to split a string = ['O little forests,'] so that the output includes both words and spaces, with the last comma appended to the last words. Here's what the desired output should look like:
output = ['O', ' ', 'little', ' ', 'forests,']
I was able to split the given string into a list of words with spaces excluded by using line.split(). I welcome your suggestions!