You can download this code by clicking the button below.
This code is now available for download.
This function accepts a list of tuples and sorts the list based on the first element of each tuple.
Technology Stack : list comprehension, lambda expression, sorted function
Code Type : Sort function
Code Difficulty :
def aorded_list(lst):
return sorted(lst, key=lambda x: x[0])