I want to make a new list from another list of words; when a certain condition of a word is fulfilled. In this case, I want to add all the words of length 9 to the new list.
I used:
resultReal = [y for y in resultVital if not len(y) < 4]
delete all records whose length is less than 4. However, I do not want to delete records now. I want to create a new list with words, but leave them in the old list.
Maybe something like this:
if len(word) == 9: newlist.append()
Thank you
source share