Dictionary-Indexed Sorting Function

  • Share this:

Code introduction


Sorts a list based on the values of a dictionary


Technology Stack : sorted, dict, lambda expression

Code Type : Function

Code Difficulty : Intermediate


                
                    
def aord(arg1, arg2):
    return sorted(arg1, key=lambda x: arg2[x])