发布时间:2019-09-02 07:41:55编辑:auto阅读(1863)
dict = [
{'id':'4','name':'b'},
{'id':'6','name':'c'},
{'id':'3','name':'a'},
{'id':'1','name':'g'},
{'id':'8','name':'f'}
]
dict_b = sorted(dict, key=lambda a:a['id'])
print dict_b
排序后:[{'id': '1', 'name': 'g'}, {'id': '3', 'name': 'a'}, {'id': '4', 'name': 'b'}, {'id': '6', 'name': 'c'}, {'id': '8', 'name': 'f'}]
上一篇: python web.py使用flup
下一篇: 朴素贝叶斯算法的Python实现
47867
46433
37321
34767
29336
25999
24952
19970
19568
18056
5810°
6436°
5953°
5978°
7083°
5928°
5969°
6461°
6425°
7803°