如何在 Python 中根据两个元素对列表列表进行排序?

How to sort list of list on the basis of two elements, in Python?

我有一个=[[1,2],[2,1],[3,2],[5,1],[4,1]]
我想将结果排序列表作为
[[2,1],[4,1],[5,1],[1,2],[3,2]]

我通过以下操作得到了这个-
a.sort(key=lambda tup:tup[0])
a.sort(key=lambda tup:tup[1])