I have a nested list and another nested list which is a subset of the first list:
lst = [[1, 2], [3, 4], [1, 2], [5, 6], [8, 3], [2, 7]]
sublst = [[1, 2], [8, 3]]
How can I find the inner lists which are not in the sublist. The desired output using the above example is:
diff = [[3, 4], [5, 6], [2, 7]]
Use a list comprehension:
or
filter():