What is the use of frozenset in Python?

A frozenset is a collection of unique values in Python.

In addition to all the properties of set, a frozenset is immutable and hashable.

Once we have set the values in a frozenset, we cannot change.

So we cannot use and update methods from set on frozenset.

Being hashable, we can use the objects in frozenset as keys in a Dictionary.


Posted

in

Tags:

Comments

Leave a Reply