Python 3.13.6 (tags/v3.13.6:4e66535, Aug 6 2025, 14:36:00) [MSC v.1944 64 bit (AMD64)] on win32 Enter "help" below or click "Help" above for more information. from typing import Dict, Optional def get_max_value(data_dict: Dict[str, int]) -> Optional[int]: """Calculates the maximum of all integer values in the dictionary.""" if len(data_dict) == 0: return None else: return max(data_dict.values()) get_max_value d1 = {'a': 100, 'b': 'hello', 'c': 1, 'd': 40} d1 {'a': 100, 'b': 'hello', 'c': 1, 'd': 40} get_max_value(d1) Traceback (most recent call last): File "", line 1, in get_max_value(d1) File "", line 6, in get_max_value return max(data_dict.values()) TypeError: '>' not supported between instances of 'str' and 'int' d2 = {'a': 100, 'b': 7, 'c': 1, 'd': 40} get_max_value(d2) 100 d3 = {} get_max_value(d3) try: # Code that might raise an error result = 10 / 0 except ZeroDivisionError as e: # 'e' is the exception object; printing it shows the specific error message print("An error occurred:", e) print("Error type:", type(e).__name__) An error occurred: division by zero Error type: ZeroDivisionError try: print(f"get_max_value({d5}): {get_max_value(d5)}") except Exception as e: # 'e' is the exception object; printing it shows the specific error message print("An error occurred:", e) print("Error type:", type(e).__name__) An error occurred: name 'd5' is not defined Error type: NameError d5 = {'a': 100, 'b': 'hello', 'c': 1, 'd': 40} try: print(f"get_max_value({d5}): {get_max_value(d5)}") except Exception as e: # 'e' is the exception object; printing it shows the specific error message ... print("An error occurred:", e) ... print("Error type:", type(e).__name__) ... ... An error occurred: '>' not supported between instances of 'str' and 'int' Error type: TypeError >>> type(d5) >>> dir(d5) ['__class__', '__class_getitem__', '__contains__', '__delattr__', '__delitem__', '__dir__', '__doc__', '__eq__', '__format__', '__ge__', '__getattribute__', '__getitem__', '__getstate__', '__gt__', '__hash__', '__init__', '__init_subclass__', '__ior__', '__iter__', '__le__', '__len__', '__lt__', '__ne__', '__new__', '__or__', '__reduce__', '__reduce_ex__', '__repr__', '__reversed__', '__ror__', '__setattr__', '__setitem__', '__sizeof__', '__str__', '__subclasshook__', 'clear', 'copy', 'fromkeys', 'get', 'items', 'keys', 'pop', 'popitem', 'setdefault', 'update', 'values'] >>> s = ' HeLLo ' >>> s ' HeLLo ' >>> s.lower() ' hello ' >>> s.lower().strip() 'hello'