我想在python中按名称忽略ignore_list中的所有项目。例如考虑
fruit_list = ["apple", "mango", "strawberry", "cherry", "peach","peach pie"]
allergy_list = ["cherry", "peach"]
good_list = [f for f in fruit_list if (f.lower() not in allergy_list)]
print good_list
我也希望 good_list 忽略“桃派”,因为桃子在过敏列表中,而桃子派包含桃子:-P