Sorting list of lists by the first element of each sub-list

How to sort a list of lists according to the first element of each list?

For example, giving this unsorted list:

[[1,4,7],[3,6,9],[2,59,8]]

The sorted result should be:

[[1,4,7],[2,59,8],[3,6,9]]

Leave a Comment