(1)删除列表中所有'a':
l = [0,1,'a',2,'a','a',3,4]
l = [x for x in l if x != 'a']
print(l)
>>[0,1,2,3,4]
(2)删除列表中所有'a'和‘b’:
delete_list = ['a','b']
l = [0,'a',1,2,'b','a',3,4]
l = [x for x in l if x not in delete_list]
print(l)
>>[0,1,2,3,4]
--by Python 3.6