MemotivaBuilt-in data types

What is the difference between a set and a frozenset?

Built-in data types

Audio flashcard · 0:11

Nortren·

What is the difference between a set and a frozenset?

0:11

A set is a mutable, unordered collection of unique hashable elements. A frozenset is the immutable version of a set. Frozensets are hashable themselves, so they can be elements of other sets or used as dictionary keys, while regular sets cannot.
docs.python.org