sorted():方法 对字典的键进行正向(从小到大)排序输出 dict={ "a":3,"e":15,"z":2,"g":9} dict1=sorted(dict) print(dict1) 结果: ['a'