立即学习:https://edu.csdn.net/course/play/26755/340130?utm_source=blogtoedu
lambda函数:
a = [
{"name": "Bill", "age": 40}
{"name": "Mike", "age": 12}
{"name": "Kate", "age": 29}
]
print(sorted(a, key = lambda X:X["age"]))
"""结果:
[ {"name": "Mike", "age": 12}, {"name": "Kate", "age": 29}, {"name": "Bill", "age": 40}] """