demo_howto_remove_duplicates.py:
mylist = ["a", "b", "a", "c", "c"] mylist = list(dict.fromkeys(mylist)) print(mylist)
➜ begtut>python demo_howto_remove_duplicates.py
['a', 'b', 'c']