KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I want to make a new list from another list of words; when a certain condition of the word is met. In this case I want to add all words that have the length of 9 to a new list. I have used : resultReal = [y for y in resultVital if not len(y) < 4] to remove all entries that are under the length of 4. However, I do not want to remove the entries now. I want to create a new list with the words, but keeping them in the old list. Perhaps something like this: if len(word) == 9: newlist.append()
Tags (comma-separated)
Save Edits
Cancel