from collections import OrderedDict myList = [2, 1, 2, 3, 0, 6, 7, 6, 8, 0, 4, 8] myList.append(9) final_list = list(OrderedDict.fromkeys(myList)) print(final_list)