字典不记录顺序。 你可以另外建一个列表 keys=[] 在构建字典的同时把键填到这个key中 dic[1234]="你好" keys.append(1234) 取字典的时候用keys里的有顺序的键 print(dic[keys[0]]) print(dic[keys[1]])