【发布时间】:2012-11-19 08:45:25
【问题描述】:
例如:
item =['the dog is gone', 'the dog and cat is gone']
words= ['dog','cat']
我希望能够过滤掉dog 和cat,所以它会显示为:
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)
我得到以下信息:
['the is gone', 'the cat and is gone', 'the and dog is gone']
【问题讨论】: