41.8k views
1 vote
How to remove duplicates from list in python?

2 Answers

6 votes

Sets automatically remove duplicates. You can convert it into a set, convert it back into a list, and run sorted() on the list, or your own sorting algorithm.

User Emeric
by
6.2k points
7 votes
the new way of removing duplicates from an iterable while keeping it in the original order
User Ali Hesari
by
5.9k points