What are the differences of list and dictionary?
Asked in the Phone Interview stage, this question focuses on Python data structures. Implement compare_structures(items, mapping) to return a summary containing each structure's type, length, lookup complexity, and the dictionary keys whose values are dictionaries.
Input: items is a Python list, and mapping is a Python dictionary. Output: return a dictionary with keys list_type, dict_type, list_length, dict_length, list_lookup, dict_lookup, and nested_dictionary_keys.
items is a valid Python list.mapping is a valid Python dictionary.def compare_structures(items, mapping):