Skip to content

Instantly share code, notes, and snippets.

@filipgorczynski
Created August 17, 2022 06:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save filipgorczynski/1a84635dd9d72594d22f60aace6b475c to your computer and use it in GitHub Desktop.
Save filipgorczynski/1a84635dd9d72594d22f60aace6b475c to your computer and use it in GitHub Desktop.
Show elements duplicated in a list
from collections import Counter
data = ['a', 'b', 'c', 'c', 'a', 'd', 'e', 'd']
print(
list(item[0] for item in Counter(data).most_common() if item[1] > 1)
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment