我想知道如何对列表中的列表进行排序。但是,我不想按键对齐。我想按照以下方法进行更改。
arr = [[2, 3], [5, 1], [4, 1], [5, 3], [4, 2]]
# solution...
I_want_arr = [[2, 3], [1, 5], [1, 4], [3, 5], [2, 4]]
Run Code Online (Sandbox Code Playgroud)
我尝试过这个
for i in arr:
i.sort()
Run Code Online (Sandbox Code Playgroud)
但是,它不起作用