#Sorting a dictionary.
17 messages · Page 1 of 1 (latest)
Hi Wealth👽.☂🕸 III,
Thanks for your question! It looks like you're asking a Python-related question, but your tags include C++, C, and C#. Could you update the tags to reflect that this is a Python question?
Thanks!
Are you talking about python? You're going to need to provide more information
You'd also have to define what an ordering looks like on a dictionary
some people sort the tuples of (key, value), others just sort based on the key
some others sort by insertion order
(actually the default behavior in e.g. modern Python)
I thought default python behavior is sort by keys
For sorted yes
if you explicitly sort
if you don't do anything the entries are sorted by insertion order (changed in idk some relatively recent 3.X version)
3.7 I think?
Oh I thought they were referring to actually sorting on the dictionary
maybe, in that case it's sorting keys with cmp or whatever
(I believe?)
ig the question is hinting at ducts with string keys so there it's alphabetical
Yes in python