Python Array

Stephen Hansen me+python at ixokai.io
Thu Mar 31 01:53:11 EDT 2016


On Wed, Mar 30, 2016, at 10:34 PM, tdsperth at gmail.com wrote:
> as you can see the option element was added third but is the first one
> displayed.
> 
> Is this just standard - I am using Python 3.5

The order of items in dictionaries is based on the hash value -- which
while stable, should be considered random and not reliable. If you want
to maintain insertion order, consider using an OrderedDict:

https://docs.python.org/3.5/library/collections.html#collections.OrderedDict




More information about the Python-list mailing list