demo_howto_remove_duplicates2.py:
def my_function(x): return list(dict.fromkeys(x)) mylist = my_function(["a", "b", "a", "c", "c"]) print(mylist)
C:\Users\My Name>python demo_howto_remove_duplicates2.py
['a', 'b', 'c']