def my_function(x):
return list(dict.fromkeys(x))
mylist = my_function(["a", "b", "a", "c", "c"])
print(mylist)
1. Use the list of items as the key to create the dictionary. This will automatically delete any duplicates, because the dictionary can not have duplicate keys.
2. Then, the dictionary is converted back to the list.