Python - Intersection of two lists of lists [duplicate]
This question already has an answer here: Removing duplicates from a list of lists 10 answers These are my two lists; k = [[1, 2], [4], [5, 6, 2], [1, 2], [3], [4], [5,9]] kDash = [[1, 2], [4], [5, 6, 2], [1, 2], [3], [4], [5,6], [1,2]] My output should be the following; [[1, 2], [4], [5, 6, 2], [1, 2], [3], [4]] how can I get to this output? thank you in advance You will have to convert the lists to list of tuples, and then use the intersection. Note that below solution may have elements in a different order, and duplicates will obviously not be there, since I'm using set. In [1]: l1 = [[1, 2