1d = {'dict1': {'foo': 1, 'bar': 2}, 'dict2': {'baz': 3, 'quux': 4}}
2
3for i in d.keys():
4 print(i)
5 for j in d[i].keys():
6 print(j)
1 d = {'dict1': {'foo': 1, 'bar': 2}, 'dict2': {'baz': 3, 'quux': 4}}
2
3 for k1,v1 in d.iteritems(): # the basic way
4 temp = ""
5 temp+=k1
6 for k2,v2 in v1.iteritems():
7 temp = temp+" "+str(k2)+" "+str(v2)
8 print temp
9