Just as tuples are immutable lists, frozensets are immutable sets: python fs = frozenset([1, 2, 3]) # fs.add(4) # Error: frozensets can't be modified Why use them?
Because they're hashable. You can use frozensets as dictionary keys or put them inside other sets: python # Sets of sets (must use frozensets) groups = {frozenset([1, 2]), frozenset([3, 4])} # Frozenset as dict key cache = {} cache[frozenset([1, 2, 3])] = "result" Regular sets can't be dict keys or set elements because they're mutable.