python - Converting a String to a List of Words? - Stack Overflow
stackoverflow.com › questions › 6181763May 31, 2011 · def split_string (string): return string.split () This function will return the list of words of a given string. In this case, if we call the function as follows, string = 'This is a string, with words!' split_string (string) The return output of the function would be. ['This', 'is', 'a', 'string,', 'with', 'words!']