python 按指定列排序

list01=[[‘1’, 508], [‘1’, 281], [‘7’, 429], [‘9’, 696], [‘9’, 576], [‘g’, 79], [‘f’, 314]]
out_data = sorted(list01, key = lambda x:x[1])

猜你喜欢

转载自blog.csdn.net/qq_23664173/article/details/85250421