Values & References11 / 18
Up next

Immutable means hashable

seen = set()
# a tuple is hashable
seen.add((1, 2))
print((1, 2) in seen)
try:
    # a list is not
    seen.add([3, 4])
except TypeError as e:
    print("unhashable:", e)
What you're solving

only immutable objects can be dict keys or set members