li = [["Jake", 24], ["Harry", 20]] li.sort(key=lambda x: x[1]) #Sorts based on 1st element of each sublist