lst = [1,2,3,2,1,5,5] lst = list(filter(lambda x:lst.count(x) != 1,lst)) lst
运行结果:
[1, 2, 2, 1, 5, 5]
2020-04-15