You can download this code by clicking the button below.
This code is now available for download.
This function takes a list of tuples containing words and returns a new list sorted based on the alphabetical order of the first word in each tuple.
Technology Stack : List (list), Tuple (tuple), String (string), Alphabetical order sorting
Code Type : Function
Code Difficulty :
def sort_words(words):
return sorted(words, key=lambda x: x[0])