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
Use the index of the second column as key
data = #2d list
sorted_by_second_column = sorted(data, key=lambda x: x[1])
2 Likes