Case-Insensitive Sort of Words List

  • Share this:

Code introduction


This function takes a list of words as an argument and returns a sorted list based on alphabetical order, case insensitive.


Technology Stack : Built-in functions: sorted, lambda expression

Code Type : Function

Code Difficulty : Intermediate


                
                    
def sort_words(words):
    return sorted(words, key=lambda word: [word.lower(), word])