Created
August 17, 2022 06:38
-
-
Save filipgorczynski/1a84635dd9d72594d22f60aace6b475c to your computer and use it in GitHub Desktop.
Show elements duplicated in a list
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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