A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://www.w3schools.com/python/ref_func_frozenset.asp below:

Website Navigation


Python frozenset() Function

Python frozenset() Function

❮ Built-in Functions

Example

Freeze the list, and make it unchangeable:

mylist = ['apple', 'banana', 'cherry']
x = frozenset(mylist)

Try it Yourself » Definition and Usage

The frozenset() function returns an unchangeable frozenset object (which is like a set object, only unchangeable).

Syntax Parameter Values Parameter Description iterable An iterable object, like list, set, tuple etc. More Examples Example

Try to change the value of a frozenset item.

This will cause an error:

mylist = ['apple', 'banana', 'cherry']
x = frozenset(mylist)
x[1] = "strawberry"

Try it Yourself »

❮ Built-in Functions

Track your progress - it's free!


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4