Python frozenset() FunctionThe python frozenset() function returns an immutable frozenset object initialized with elements from the given iterable. SignatureParametersiterable: An iterable object such as list, tuple etc. ReturnIt returns an immutable frozenset object initialized with elements from the given iterable. Python frozenset() Function Example 1The below example shows the working of frozenset(). Output: Frozen set is: frozenset({'o', 'm', 's', 'r', 't'}) Empty frozen set is: frozenset() Explanation: In the above example, we take a variable that consists tuple of letters and returns an immutable frozenset object. Python frozenset() Function Example 2The below example shows the working of frozenset() with dictionaries. Output: Frozen set is: frozenset({'name', 'sex', 'age'}) Next TopicPython Functions |
We provides tutorials and interview questions of all technology like java tutorial, android, java frameworks
G-13, 2nd Floor, Sec-3, Noida, UP, 201301, India