Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

looping nested dictionaries

d = {'dict1': {'foo': 1, 'bar': 2}, 'dict2': {'baz': 3, 'quux': 4}}

for i in d.keys():
    print i
    for j in d[i].keys():
        print j
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #looping #nested #dictionaries
ADD COMMENT
Topic
Name
3+5 =