Regarding Dictionaries in python

David Eppstein eppstein at ics.uci.edu
Mon Apr 21 20:57:13 EDT 2003


In article <mailman.1050957134.26691.python-list at python.org>,
 "Mehta, Anish" <Anish.Mehta at enst-bretagne.fr> wrote:

> why it is not showing the items in order in which i have inserted. 
> Please tell me why it is happing like this.

Because dictionaries store things out-of-order, in hash tables, so that 
they can perform lookups quickly.  If maintaining the order of some 
things is important, that's what lists are for.

-- 
David Eppstein                      http://www.ics.uci.edu/~eppstein/
Univ. of California, Irvine, School of Information & Computer Science




More information about the Python-list mailing list