You are thinking about looping through dictionaries wrongly, when you do -
for i in dict:
i is actually the key in the dictionary , not the value. Example -
>>> d = {1:2,3:4}
>>> for i in d:
... print(i)
...
1
3
As you can see , it printed the keys not the values. So if you need the keys as well as values, iterate over iteritems() (for Python 2.x) , or items() (for Python 3.x) . Both return a list of tuples where the first element of tuple is the key and second element is the value.
Secondly, after that, you are only getting the dictionaries for each name as well as age separately , if you want to get them together, I would suggest going through the keys of one of them and getting name and age using that. Example -
py_dict = {'age': {0: 10, 1: 30.0, 2: 19.0}, 'name': {0: u'Michael', 1: u'Andy', 2: u'Justin'}}
for key in py_dict['name']:
print "Name:",py_dict['name'][key]
print "Age:", py_dict['age'][key]
print
Example/Demo -
>>> py_dict = {'age': {0: 10, 1: 30.0, 2: 19.0}, 'name': {0: u'Michael', 1: u'Andy', 2: u'Justin'}}
>>>
>>> for key in py_dict['name']:
... print "Name:",py_dict['name'][key]
... print "Age:", py_dict['age'][key]
... print
...
Name: Michael
Age: 10
Name: Andy
Age: 30.0
Name: Justin
Age: 19.0
Another note, you seem to be using Python 2.x , in which case print is a statement , not a function, if you want the print function, you would need to do - from __future__ import print_function . But you do not really need them, use them as statements, as I did above.