[Tutor] assigning values to dictionary

W W srilyk at gmail.com
Fri Oct 3 20:05:31 CEST 2008

On Fri, Oct 3, 2008 at 1:02 PM, jeremiah <jeremiah.jester at panasonic.aero>wrote:

> i think i figured it out. The result is that I have a dictionary within
> a dictionary..i think.
> for example:
> {'mcdonalds': {'hamburger': 'big mac','drink':'coke'}}
> How would I go about itterating through this?

for k, v in items(mydict):
    for k, v in items(v):
       print k, v

I think that should work
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20081003/4820b5c0/attachment.htm>

More information about the Tutor mailing list