So stdin returns a string of text into a list, and multiple lines of text are all list elements.
How do you split them all into single words?
mylist = ['this is a string of text
', 'this is a different string of text
', 'and for good measure here is another one
']
wanted output:
newlist = ['this', 'is', 'a', 'string', 'of', 'text', 'this', 'is', 'a', 'different', 'string', 'of', 'text', 'and', 'for', 'good', 'measure', 'here', 'is', 'another', 'one']
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…