Python Forum
dictionary insertion order
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
dictionary insertion order
#3
oooh, i didn't think about comparing .keys() to compare the insertion order. but that seems to work.
dx = {}
dx['a'] = 1
dx['b'] = 2
dx['c'] = 3
dy = {}
dy['c'] = 3
dy['b'] = 2
dy['a'] = 1
print(dx==dy)
print(dx.keys())
print(dy.keys())
Tradition is peer pressure from dead people

What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Reply


Messages In This Thread
dictionary insertion order - by Skaperen - Aug-09-2023, 06:26 PM
RE: dictionary insertion order - by DeaD_EyE - Aug-09-2023, 07:29 PM
RE: dictionary insertion order - by Skaperen - Aug-09-2023, 10:13 PM

Forum Jump:

User Panel Messages

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