[Tutor] List index usage: is there a more pythonesque way?
waynejwerner at gmail.com
Mon Apr 19 16:58:24 CEST 2010
On Mon, Apr 19, 2010 at 9:23 AM, Alan Gauld <alan.gauld at btinternet.com>wrote:
> "C M Caine" <cmcaine at googlemail.com> wrote
>> That's the first I've read of iterating through dictionaries, I'd
>> assumed it was impossible because they're unordered.
> Iteration doesn't require order, only to get each item once.
> Even in very old Python versions you could iterate a dictionary via the
> keys() method. More recently you can do it directly - although the effect is
> the same. There is no guarantee of order only that you process every item
And of course if you want to get the items sorted you can iterate over
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Tutor