Answers for "list remove all duplicates"

36

python remove duplicates from list

mylist = ["a", "b", "b", "c", "a"]
mylist = sorted(set(mylist))
print(mylist)
Posted by: Guest on October-26-2020
0

how to delete duplicated elements of a list

Set<String> set = new HashSet<>(yourList);
yourList.clear();
yourList.addAll(set);
Posted by: Guest on June-06-2021

Code answers related to "list remove all duplicates"

Python Answers by Framework

Browse Popular Code Answers by Language