Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
idle flips my dictionary
#2
Dictionaries use a hash table, and that's where the order of the dictionary comes from, not from how you entered it. Although I believe this behavior may be changing (or has it changed in 3.7?).

If you really need order in a dictionary, you can use OrderedDict in the collections module.
Craig "Ichabod" O'Brien - xenomind.com
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures
Reply


Messages In This Thread
idle flips my dictionary - by shayhi - Sep-20-2018, 02:31 AM
RE: idle flips my dictionary - by ichabod801 - Sep-20-2018, 03:35 AM
RE: idle flips my dictionary - by snippsat - Sep-20-2018, 05:10 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  IDLE not importing pygame (ok outside of IDLE) miner_tom 1 4,347 Sep-14-2018, 07:54 PM
Last Post: Larz60+
  Python IDLE 3.6.2 on WIn7 vs Pyhton 3 IDLE raspberry djdan_23 5 7,004 Sep-07-2017, 12:51 PM
Last Post: Larz60+

Forum Jump:

User Panel Messages

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