Source Code:
(back to article)
original_list = [1, 2, 3, 4, 5, 6, 7, 8, 9, 2, 4, 6, 8] duplicate_list = [] for i in original_list: if original_list.count(i) > 1: if i not in duplicate_list: duplicate_list.append(i) print(duplicate_list)
Result:
Report an issue