+ 1
Python. Order of keys in dictionary.
I have to print keys of dictionary in right order, but I can get only random order. Can you give me some advices? https://code.sololearn.com/ccUpNDk4Pyav/?ref=app https://code.sololearn.com/ccUpNDk4Pyav/?ref=app
2 Réponses
+ 10
Yes, an ordered dict may be what you are looking for.
https://code.sololearn.com/cBUNKDVhCC5Z/?ref=app
+ 2
I can use collections.OrderedDict
https://code.sololearn.com/ckFGMZXAt5pL/?ref=app