frozenset
Frozenset is an immutable, unordered collection of distinct elements in Python. It is the immutable counterpart to the built-in set type. Like a set, a frozenset cannot contain duplicates and supports membership testing, iteration, and standard set operations, but its contents cannot be changed after creation.
Creation and immutability: A frozenset is created with the frozenset() constructor, optionally with an iterable, e.g.,
Operations: Frozensets support union, intersection, difference, and symmetric_difference using operators |, &, -, and ^, or the corresponding methods. The
Limitations: A frozenset does not support in-place modification methods such as add, remove, discard, pop, or
Usage: Frozensets are useful when a fixed collection must be used as a dictionary key or as