Как проверить, есть ли дубликаты в списке Python
>>> your_list = ['one', 'two', 'one']
>>> len(your_list) != len(set(your_list))
True
Busy Boar
>>> your_list = ['one', 'two', 'one']
>>> len(your_list) != len(set(your_list))
True
from collections import Counter
def get_duplicates(array):
c = Counter(array)
return [k for k in c if c[k] > 1]