You can download this code by clicking the button below.
This code is now available for download.
This function takes a list of names as input, sorts them by the length of the names, and returns the sorted list.
Technology Stack : list, sorting, key
Code Type : Function
Code Difficulty : Intermediate
def sorted_names_by_length(names):
return sorted(names, key=len)