[Tutor] dictionary

Pujo Aji ajikoe at gmail.com
Mon Oct 24 09:18:50 CEST 2005


you work with dictionary.
In dictionary you work with the key to get your value. You don't care about
how python arrange the key.
your key here are: 'res', 'com', 'ind', and 'other'
when you want to get your value you just type:
landUse['res'] this you will get 1
landUse['ind'] this you will get 3
 cheers,
pujo

 On 10/24/05, Shi Mu <samrobertsmith at gmail.com> wrote:
>
> I typed:
> landUse = {'res': 1, 'com': 2, 'ind': 3, "other" :[4,5,6,7]}
> and when i checked landUse, I found it become:
> {'ind': 3, 'res': 1, 'other': [4, 5, 6, 7], 'com': 2}
> why the order is changed?
> _______________________________________________
> Tutor maillist - Tutor at python.org
> http://mail.python.org/mailman/listinfo/tutor
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/tutor/attachments/20051024/c87a9ba4/attachment.html


More information about the Tutor mailing list