I had a list like:
l = [[(3,4)], [(3,7)], [(3,8)]]
I used the chain()
function to flat the list, now I have a list like:
l2 = [3,4,3,7,3,8]
I want to separate the duplicate items into another list:
l3 = [3,3,3]
l4 = [4,7,8]
I used the set()
function, but it destroyed the duplicate items and resulted in:
l3 = [4,7,8]
but I want to obtain both of them separately