How to Remove Duplicate Lists from a List in Python

Viewed 35

How do I remove duplicate lists from a list in Python manually?

Let's say I have a list of lists:

lsts = [['bob', 'ryan'], ['jess', 'kim'], ['bob', 'ryan'], ['ryan', 'bob'], ['kim', 'jess'], 
       ['oliver', 'lim']]

The order shouldn't matter here as I want to remove duplicate lists that contain same elements.

I want to return this:

ret_lsts = [['bob', 'ryan'], ['jess', 'kim'], ['oliver', 'lim']]

Is there a simple manual way to achieve this in Python?

0 Answers
Related