Sorting List Function

  • Share this:

Code introduction


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


Technology Stack : Built-in library: sorted

Code Type : Function

Code Difficulty :


                
                    
def sorted_list(list_to_sort):
    """
    Sorts a list in ascending order.
    """
    return sorted(list_to_sort)