Python ProgrammingPython Programming

Remove the duplicate lists of list in Python

thelist = [[1, 2, 3], [4, 5, 6], [1, 2, 3], [7, 8, 9], [4, 5, 6]]

print(set(tuple(row) for row in thelist))

print([list(item) for item in set(tuple(row) for row in thelist)])
Output
{(7, 8, 9), (1, 2, 3), (4, 5, 6)}
[[7, 8, 9], [1, 2, 3], [4, 5, 6]]