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
本文来自博客园,作者:Hany47315,转载请注明原文链接:https://www.cnblogs.com/hany-postq473111315/p/12705591.html