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.

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})

Subscribe to pythoncheatsheet.org

Join 9.800+ Python developers in a two times a month and bullshit free publication , full of interesting, relevant links.