You can download this code by clicking the button below.
This code is now available for download.
Sorts the elements of the list arg1 based on their index positions in the list arg2.
Technology Stack : None, sorted, lambda
Code Type : Sort function
Code Difficulty : Intermediate
def aordiff(arg1, arg2):
if arg1 is None or arg2 is None:
return None
return sorted(arg1, key=lambda x: arg2.index(x))