python multi-part question and need an explanation and answer to help me learn.# Question 1 (15 points)# define a function that takes in:# (1) a string # (2) a list (of arbitrary objects)# and returns a dictionary such that # # If parameter 1 is “neighbor”, then the dictionary# is created by using the values of the list as both# the key and value of dictionary. For example# to_dictionary(‘neighbor’, [‘a’, 1, 4, 5, 9])# > {‘a’: 1, 4: 5, 9: None}# * if the list of objects is odd, the last key’s value should be None# # If the parameter 1 is “index”, then the dictionary# is created by using the indices of the list’s items# as key, and the specific item as the value. For example# to_dictionary(‘index’, [‘a’, 2, 3, ‘b’])# > {0: ‘a’, 1: 2, 2: 3, 3: ‘b’}# HINT: for “index”, utilizing a for loop to iterate through# a list with access to the each value and its index may be helpful# If the parameter 1 is anything else, return a copy of the list.# Question 2 (15 points)# Define a function that takes in:# (1) a dictionary# (2) a search term# returns 2 items: a list containing the path to the key (or search term)# and the value of the search term; return None for the second item# if the key doesn’t exists# my_dict = {# ‘a’: {# ‘b’: {# ‘c’: 5# },# ‘d’: 7# },# ‘e’: 8# }# my_func(my_dict, ‘c’)# > [‘a’, ‘b’, ‘c’], 5# my_func(my_dict, ‘z’)# > [], None# my_func(my_dict, ‘b’)# > [‘a’, ‘b’], {‘c’: 5}# Question 3 (15 points)# Define a function that takes in:# (1) a dictionary# (2) a list of objects# (3) a default value# Alter the dictionary to include the default value# at the path given by the list of objects. For example# # my_dict = {# ‘a’: {# ‘b’: {# ‘c’: 5# },# ‘d’: 7# },# ‘e’: 8# }# my_func(my_dict, [‘a’, ‘b’, ‘z’], ‘new_value’ )# ># {# ‘a’: {# ‘b’: {# ‘c’: 5,# ‘z’: ‘new_value’# },# ‘d’: 7# },# ‘e’: 8# }# HINT: remember a dictionary holds a pointer to nested dictionaries.# Many possible ways to do it. Try looking at dict’s setdefault method# Question 4 (20 points)# define a global dictionary of whose values are functions # of mathematical operations. Such as the example below.# {# ‘add’: add # ‘subtract’: subtract# ‘divide’: divide# ‘multiply’: multiply# }# given that add, subtract, divide and multiply# are functions that you also defined.# Then define a function that takes as input: # (1) the name of a math operation and # (2) 2 integers# and returns the result of the appropriate function. # If an operation name doesn’t exist, return -1# Each time a specific math function is called, it should # print out something to the effect of “X function has been # called Y times”, where x is the name of the function, and Y# is an integer representing how many times that particular function# has been called.# # Take a look at the example below. Lines with > are output lines.# print(perform_op(‘add’, 4, 5))# > “Add has been called 1 times”# > 9# print(perform_op(‘multiply’, 2, 3))# > “Multiply has been called 1 times”# print(perform_op(‘add’, 5, 5))# > “Add has been called 2 times”# > 10Requirements: 4 questions