You can download this code by clicking the button below.
This code is now available for download.
The function takes a list as input, first removes duplicates using set, then sorts the result with the sorted function while maintaining the original order of elements in the list.
Technology Stack : Built-in libraries - list, set, sorted
Code Type : Function
Code Difficulty : Intermediate
def sorted_unique_list(input_list):
return sorted(set(input_list), key=input_list.index)