Dictionaries are used to store data values in key:value pairs.Key value is provided in the dictionary to make it more optimized. Dictionaries are written with curly brackets, and have keys and values. Dictionaries are mutable. We can add new items or change the value of existing items.
Create an Dictionary elements
# empty dictionary
my_dict = {}# dictionary with integer keys
my_dict = {1: 'apple', 2: 'banana', 5: [2, 4, 3] }# dictionary with string keys
my_dict = {'apple': 3, 'banana': 5, 'list'…