Sorting List in Dictionary Order

  • Share this:

Code introduction


This function takes a list as an argument and returns a new list with the elements sorted in dictionary order.


Technology Stack : Built-in function (sorted), lambda expression

Code Type : Function

Code Difficulty : Intermediate


                
                    
def aorded_list_items(lst):
    return sorted(lst, key=lambda x: x.lower())