所以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']