Python List Remove Duplicates
In Python list, remove duplicates by:
char_list = ["a", "a", "a", "b", "c"]
char_list = list(dict.fromkeys(char_list))
print(char_list)
Output:
['b', 'a', 'c']
Or if you care about the ordering, do it like this:
from collections import OrderedDict...
artturijalli.hashnode.dev2 min read