1# dictionary parameters
2keys = ['a', 'b', 'c']
3values = [1, 2, 3]
4# create dictionary func.
5def create_dictionary(keys, values):
6 result = {} # empty dictionary
7 for key, value in zip(keys, values):
8 result[key] = value
9 return result
10# use create_dictionary func.
11print(create_dic(keys=keys, values=values))
12
13""" output:
14{'a': 1, 'b': 2, 'c': 3}
15"""
1d = {'key': 'value'}
2print(d)
3# {'key': 'value'}
4d['mynewkey'] = 'mynewvalue'
5print(d)
6# {'key': 'value', 'mynewkey': 'mynewvalue'}
7