stdin将文本字符串返回为列表,多行文本则成为列表的不同元素。如何将它们全部拆分为单个单词?
mylist = ['this is a string of text \n', 'this is a different string of text \n', 'and for good measure here is another one \n']
期望输出:
newlist = ['this', 'is', 'a', 'string', 'of', 'text', 'this', 'is', 'a', 'different', 'string', 'of', 'text', 'and', 'for', 'good', 'measure', 'here', 'is', 'another', 'one']