I am new to Python, so I might be missing something simple.
I am given an example:
string = \"The , world , is , a , happy , place \"
Strings have a split() method for this. It returns a list:
>>> string = "The , world , is , a , happy , place "
>>> string.split(' , ')
['The', 'world', 'is', 'a', 'happy', 'place ']
As you can see, there is a trailing space on the last string. A nicer way to split this kind of string would be this:
>>> [substring.strip() for substring in string.split(',')]
['The', 'world', 'is', 'a', 'happy', 'place']
.strip() strips whitespace off the ends of a string.
Use a for loop to print the words.