The frozenset function
The function frozenset
transforms a set into immutable. In the function parameter we specify the set that we need to make immutable.
Syntax
frozenset(set)
Example
Let's make our set immutable:
st = {'a', 'b', 'c'}
res = frozenset(st)
print(res)
Result of code execution:
frozenset({'a', 'b', 'c'})