Regarding Dictionaries in python

John Hall wweexxsseessssaa at telusplanet.net
Mon Apr 21 18:36:37 EDT 2003


On Mon, 21 Apr 2003 22:34:35 +0200, "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 the order of items in dictionaries is inherently undefined, or
whimsical if you prefer. Your book should tell you that, but of course
you need to read the relevant sentence.

There are cookbook recipes for sorting them if you really need to.

-- 
John W Hall <wweexxsseessssaa at telusplanet.net>
Calgary, Alberta, Canada.
"Helping People Prosper in the Information Age"




More information about the Python-list mailing list