Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

check list for duplicate values python

a = [1,2,3,2,1,5,6,5,5,5]

import collections
print([item for item, count in collections.Counter(a).items() if count > 1])

## [1, 2, 5]
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #check #list #duplicate #values #python
ADD COMMENT
Topic
Name
9+3 =