1a = [1,2,3,2,1,5,6,5,5,5]
2
3import collections
4print([item for item, count in collections.Counter(a).items() if count > 1])
5
6## [1, 2, 5]
1lst = [ 3, 6, 9, 12, 3, 30, 15, 9, 45, 36, 12, 12]
2dupItems = []
3uniqItems = {}
4for x in lst:
5 if x not in uniqItems:
6 uniqItems[x] = 1
7 else:
8 if uniqItems[x] == 1:
9 dupItems.append(x)
10 uniqItems[x] += 1
11print(dupItems)