people.sort(key=lambda x:(-x[0],x[1])) # -x[0]表示降序,x[1]表示升序
输入:[[7,0], [4,4], [7,1], [5,0], [6,1], [5,2]]
输出:[[5, 0], [7, 0], [5, 2], [6, 1], [4, 4], [7, 1]]
people.sort(key=lambda x:(-x[0],x[1])) # -x[0]表示降序,x[1]表示升序
输入:[[7,0], [4,4], [7,1], [5,0], [6,1], [5,2]]
输出:[[5, 0], [7, 0], [5, 2], [6, 1], [4, 4], [7, 1]]