[python][原创]按照指定list元素索引排序

a = [['apple', '3'], ['peach', '2'], ['pear', '1']]
b = sorted(a, key=lambda x: x[1])
print(b)

 

你可能感兴趣的:(Python)