For example:
item =['the dog is gone', 'the dog and cat is gone']
words= ['dog','cat']
I want to be able to filter out the dog
and cat
so it would read:
item=['the is gone', 'the and is gone']
item1=[]
for w in words:
for line in item:
if w in line:
j=gg.replace(it,'')
item1.append(j)
I get the following:
['the is gone', 'the cat and is gone', 'the and dog is gone']