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 = [\'thi
Besides the list comprehension answer above that i vouch for, you could also do it in a for loop:
#Define the newlist as an empty list
newlist = list()
#Iterate over mylist items
for item in mylist:
#split the element string into a list of words
itemWords = item.split()
#extend newlist to include all itemWords
newlist.extend(itemWords)
print(newlist)
eventually your newlist
will contain all split words that were in all elements in mylist
But the python list comprehension looks much nicer and you can do awesome things with it. Check here for more:
https://docs.python.org/3/tutorial/datastructures.html#list-comprehensions