思路: keys(),values()取出键值对,转换为元组列表,对列表排序,再转换成字典
键值对->元组列表->排序列表->排序字典
dic={"name":"zs","age":18,"city":"深圳","tel":"1362626627"}
print(dict(sorted(zip(dic.keys(),dic.values()))))
来源:CSDN
作者:Angryshark_128
链接:https://blog.csdn.net/weixin_42078760/article/details/103881795