Open this example in the interactive library
Source code
values = [3, 1, 3, 2]
print(list(dict.fromkeys(values)))Sample output
[3, 1, 2]

Remove duplicates in order. A self-contained example using the Python standard library.
Open this example in the interactive library
values = [3, 1, 3, 2]
print(list(dict.fromkeys(values)))[3, 1, 2]