[Tutor] iterating data and populating a dictionary

Shrutarshi Basu technorapture at gmail.com
Thu Aug 7 07:42:58 CEST 2008


If you're just going to be using numbers as dictionary keys, it might
be simpler just to use a list structure. Dictionaries don't preserve
order, so you'd need to write extra code if you ever need to iterate
over it in order. Since your code increments field everytime it gets a
new record you can just use it as a list index and things should be
fine. Of course you might have your own reasons for using a dict, so
it's up to you.
-- 
The ByteBaker :
http://www.bytebaker.com


More information about the Tutor mailing list