1IDs = ['emp1','emp2','emp3']
2
3EmpInfo = [{'name': 'Bob', 'job': 'Mgr'},
4 {'name': 'Kim', 'job': 'Dev'},
5 {'name': 'Sam', 'job': 'Dev'}]
6
7D = dict(zip(IDs, EmpInfo))
8
9print(D)
10# Prints {'emp1': {'name': 'Bob', 'job': 'Mgr'},
11# 'emp2': {'name': 'Kim', 'job': 'Dev'},
12# 'emp3': {'name': 'Sam', 'job': 'Dev'}}
1people = {1: {'name': 'John', 'age': '27', 'sex': 'Male'},
2 2: {'name': 'Marie', 'age': '22', 'sex': 'Female'}}
3
4people[3] = {}
5
6people[3]['name'] = 'Luna'
7people[3]['age'] = '24'
8people[3]['sex'] = 'Female'
9people[3]['married'] = 'No'
10
11print(people[3])
12
13#Output:
14# {'name': 'Luna', 'age': '24', 'sex': 'Female', 'married': 'No'}
1people = {1: {'name': {'John': 'hey', 'man':'hello'} 'age': '27', 'sex': 'Male'},
2 2: {'name': 'Marie', 'age': '22', 'sex': 'Female'}}
3
4print(people[1]['name']['John'])
5print(people[1]['age'])
6print(people[1]['sex'])