Created
January 14, 2019 12:13
-
-
Save jobel-code/c16d0df1fa5a8879010e4cecf60fd463 to your computer and use it in GitHub Desktop.
Find duplicates 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
# Find duplicates in list | |
import collections | |
def find_duplicates(my_list:list)->list: | |
return [item for item, count in collections.Counter(my_list).items() if count > 1] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment