标签: python python-3.x sorting
我想根据a的值降序对b进行排序;
a = [2,1,5,3,4] b = [(0,0),(1,1),(2,2),(3,3),(4,4)]
For循环有效,但是有没有更快的方法?
结果将是:
b: [(2,2),(4,4),(3,3),(0,0),(1,1)]