def list_duplicates(seq):
    seen = set()
seen_add = seen.add
return [idx for idx, item in enumerate(seq) if item in seen or seen_add(item)]
print(list_duplicates([1, 2, 3, 2, 1, 5, 6, 5, 5, 5]))
List indexes of duplicate values in a list with Python