stus = [ {"name":"zhang","age":18}, {"name":"lisi","age":13}, {"name":"wang","age":15}, ] #名字排序 stus.sort(key = lambda x:x[‘name‘]) #age排序 stus.sort(key = lambda x:x[‘age‘])
python基础 字典排序
原文:https://www.cnblogs.com/angdh/p/11001608.html