d = [('a', 24), ('g', 52), ('i', 12)]
print(sorted(d),key = lambda x:x[1])
sorted (字典,排序的依据: 字典[key])