Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

find duplicated entries present in a list

How to Find Out the Duplicated Values Present In a List:

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)
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #find #duplicated #entries #present #list
ADD COMMENT
Topic
Name
4+4 =