list = [1,2,3,4,5,6,6,6]
un_duplicated_list = []
while list:
for i in list:
if list.count(i) > 1 and not un_duplicated_list:
un_duplicated_list.append(i)
list.remove(i)
print(list)
I am lost. I want to remove duplicated values from list and I want to keep what was duplicated in another list. like second list should be [6,6]
Please dont write completely different code just show me how can I fix on this.
ty