Case-Insensitive Sorted List Generator

  • Share this:

Code introduction


This function accepts a list as an argument and returns a sorted list. The sorting is based on the string representation of the elements in the list, ignoring case.


Technology Stack : Built-in function sorted, lambda expression

Code Type : List sort

Code Difficulty : Intermediate


                
                    
def a_sorted_list(items):
    return sorted(items, key=lambda x: x.lower())