Home >>Python Built-in Functions >Python frozenset() Function
Python frozenset() function is used to return an unchangeable frozenset object. It takes an iterable object as input and makes them immutable. Frozenset objects are like a set object but the only difference is that it's unchangeable.
Syntax:frozenset(iterable)
Parameter | Description |
---|---|
iterable | This parameter defines an iterable object like list, set, tuple etc. |
mylist = ['apple', 'banana', 'mango', 'orange']
x = frozenset(mylist)
print(x)
mylist = ['apple', 'banana', 'mango', 'orange']
x = frozenset(mylist)
x[1] = "watermelon"
print(x)