Sorting Words by Length

  • Share this:

Code introduction


This function sorts a list of words based on the length of each word and returns the sorted list.


Technology Stack : list, sorting, key

Code Type : Sort function

Code Difficulty : Beginner


                
                    
def aord_by_length(words):
    return sorted(words, key=len)                
              
Tags: