Python Forum
i keep getting unordered output when using dictionaries
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
i keep getting unordered output when using dictionaries
#3
(Aug-23-2019, 10:02 AM)fishhook Wrote: Dictionaries do not keep the order. If you really need to keep order use OrderedDict instead.

This is not totally correct. Starting from Python 3.6 dictionaries are 'insertion ordered' and from Python 3.7 it's guaranteed. Obviously OP is not using recent versions of Python (Python 3.6 was released on December 23, 2016)
I'm not 'in'-sane. Indeed, I am so far 'out' of sane that you appear a tiny blip on the distant coast of sanity. Bucky Katt, Get Fuzzy

Da Bishop: There's a dead bishop on the landing. I don't know who keeps bringing them in here. ....but society is to blame.
Reply


Messages In This Thread
RE: i keep getting unordered output when using dictionaries - by perfringo - Aug-23-2019, 11:22 AM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020