Print original input order of dictionary in python

后端 未结 5 692
你的背包
你的背包 2021-01-11 10:56

How do I print out my dictionary in the original order I had set up?

If I have a dictionary like this:

smallestCars = {\'Civic96\':          


        
5条回答
  •  说谎
    说谎 (楼主)
    2021-01-11 11:25

    Dictionaries are not required to keep order. Use OrderedDict.

提交回复
热议问题