Source Code:
(back to article)
original_list = [1, 2, 3, 4, 5, 1, 2, 3, 4, 5] unique_list = [x for i, x in enumerate(original_list) if x not in original_list[:i]] print(unique_list)
Result:
Report an issue