HELP! Simple question re: dictionaries
chibaA at TinterlogD.Tcom
chibaA at TinterlogD.Tcom
Wed May 10 15:49:17 EDT 2000
More information about the Python-list mailing list
Wed May 10 15:49:17 EDT 2000
- Previous message (by thread): HELP! Simple question re: dictionaries
- Next message (by thread): HELP! Simple question re: dictionaries
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
I'll give it a shot - thanks! kc On 10 May 2000 20:34:09 +0100, Michael Hudson <mwh21 at cam.ac.uk> wrote: >chibaA at TinterlogD.Tcom writes: > >> Hi, >> >> I just want to write a for statement to go through each element of a >> dictonary. I would have assumed it would look something like this >> (argumentList being the dictonary): >> >> for ___ in argumentList: >> # whatever... >> >> ... but I'm not sure of the exact syntax. If anyone knows, could you >> let me know? Thanks! > >for key,value in argumentList.items(): > # whatever ... > >is pretty idiomatic... > >Cheers, >M. > >-- >34. The string is a stark data structure and everywhere it is > passed there is much duplication of process. It is a perfect > vehicle for hiding information. > -- Alan Perlis, http://www.cs.yale.edu/~perlis-alan/quotes.html
- Previous message (by thread): HELP! Simple question re: dictionaries
- Next message (by thread): HELP! Simple question re: dictionaries
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list