Source Code:
(back to article)
from collections import OrderedDict my_list = [1, 2, 2, 3, 4, 4, 5] my_dict = OrderedDict.fromkeys(my_list) unique_list = list(my_dict.keys()) print(unique_list)
Result:
Report an issue