Exercise 1 solution def can_be_key(value): try: hash(value) return True except TypeError: return False for v in [5, "hi", (1, 2), [1, 2], (1, [2]), {1}, frozenset({1}), None]: print(repr(v), can_be_key(v)) Output: 5 True 'hi' True (1, 2) True [1, 2] False (1, [2]) False {1} False frozenset({1}) True None True The tuple rule explains (1, 2) -> True and (1, [2]) -> False: a tuple is hashable only when everything inside it is hashable. The list inside the second tuple makes the whole tuple unhashable.