1from collections import defaultdict
2d = defaultdict(dict)
3d['dict1']['innerkey'] = 'value'
4
5>>> d # currently a defaultdict type
6defaultdict(<type 'dict'>, {'dict1': {'innerkey': 'value'}})
7>>> dict(d) # but is exactly like a normal dictionary.
8{'dict1': {'innerkey': 'value'}}
1people = {1: {'name': 'John', 'age': '27', 'sex': 'Male'},
2 2: {'name': 'Marie', 'age': '22', 'sex': 'Female'}}
3
4print(people)