📜  在 python 代码示例中计算列表中的重复项

📅  最后修改于: 2022-03-11 14:45:29.759000             🧑  作者: Mango

代码示例1
some_list=['a','b','c','b','d','m','n','n']

 my_list=sorted(some_list)
 
duplicates=[]
for i in my_list:
     if my_list.count(i)>1:
         if i not in duplicates:
             duplicates.append(i)
 
print(duplicates)