Grabbing previous iteration in a dict
dannywebster at googlemail.com
dannywebster at googlemail.com
Fri May 9 05:10:56 EDT 2008
Hello all,
I have a dictionary of which i'm itervalues'ing through, and i'll be
performing some logic on a particular iteration when a condition is
met with trusty .startswith('foo'). I need to grab the previous
iteration if this condition is met. I can do something with an extra
var to hold every iteration while iterating, but this is hacky and not
elegant.
Is there a mechanism whereby I can just index the dict value
subscripts like in an array? I could just rewind by 1 if so.
Cheerz
dan.
More information about the Python-list
mailing list