Skip to content

Instantly share code, notes, and snippets.

@complexsplit
Created July 28, 2021 17:28
Show Gist options
  • Save complexsplit/55714b8c7e260aeb3ad70306c5572a1b to your computer and use it in GitHub Desktop.
Save complexsplit/55714b8c7e260aeb3ad70306c5572a1b to your computer and use it in GitHub Desktop.
pythons-collections-duplicate
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])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment