arr = [{ "name": "name_1", "level": 1}, { "name": "name_2", "level": 0}, { "name": "name_3", "level": 3}]arr.sort(key = lambda x:x["level"])print arr
本文共 209 字,大约阅读时间需要 1 分钟。
arr = [{ "name": "name_1", "level": 1}, { "name": "name_2", "level": 0}, { "name": "name_3", "level": 3}]arr.sort(key = lambda x:x["level"])print arr
转载于:https://www.cnblogs.com/daas/p/6140245.html