Is there a way to sort a two-dimensional list on the values of the second 'column'?

For example, in the Python Lists Project, I have created a two-dimensional list by joining the names and insurance costs, in that order. Is it possible to sort the list by the insurance cost? Thanks :slight_smile:


Use the index of the second column as key

data = #2d list
sorted_by_second_column = sorted(data, key=lambda x: x[1])