Iterating over the data items in a dict.

Syver Enstad syver at NOSPAMcyberwatcher.com
Mon Nov 6 18:03:25 CET 2000


"Gaute B Strokkenes" <gs234 at cam.ac.uk> wrote in message
news:4ak8ahfbet.fsf at kern.srcf.societies.cam.ac.uk...
>
> I would like to iterate over the data items, not the keys, in a dict.

I think you can do it like this:

for key, value in dict.items:
    # do stuff





More information about the Python-list mailing list