[Solved] Extract single words or phrases from list of strings which are not in base string
Update This version adds all already seen words to the exclude set: exclude = set(‘why kid is upset’.split()) list_of_strings = [‘why my kid is upset’, ‘why beautiful kid is upset’, ‘why my 15 years old kid is upset’, ‘why my kid is always upset’] res = [] for item in list_of_strings: words = item.split() res.append(‘ … Read more