Python frozenset() built-in function

From the Python 3 documentation

Return a new frozenset object, optionally with elements taken from iterable. frozenset is a built-in class. See frozenset and Set Types — set, frozenset for documentation about this class.

Introduction

The frozenset() function in Python is a built-in function that creates an immutable, hashable set from an iterable. Unlike a regular set, a frozenset cannot be modified after its creation, which means you cannot add or remove elements. This immutability makes it suitable for use as a dictionary key or as an element in another set.

Examples

frozenset([1, 2, 3])
frozenset({1, 2, 3})
frozenset((1, 2, 3))
frozenset({1, 2, 3})
frozenset({1, 2, 3})
frozenset({1, 2, 3})