Sorting Words by ASCII Values

  • Share this:

Code introduction


This function takes a list of strings and returns a sorted list based on the ASCII values of characters.


Technology Stack : Built-in functions

Code Type : Sort function

Code Difficulty : Beginner


                
                    
def aordify(words):
    return sorted(words, key=lambda s: [ord(c) for c in s])