Python frozenset()
Python frozenset() class
The frozenset() class in Python returns a new frozenset object, optionally with elements taken from iterable.
Syntax
class frozenset([iterable])
Parameter
iterable: This parameter represents an iterable object, like list, set, tuple etc.
Return
This class returns an unchangeable frozenset object.
Example 1
# Python program expalining
# the frozenset() function
# tuple of numbers
val = (11, 12, 13, 14, 15, 16, 17, 18, 19)
# converting tuple to frozenset
f_num = frozenset(val)
# printing details
print("frozenset returns: ", f_num)
Output
frozenset returns: frozenset({11, 12, 13, 14, 15, 16, 17, 18, 19}) 