Home > Article > Backend Development > Detailed introduction to Python’s built-in frozenset function
English documentation:
class frozenset
([iterable ])
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.
set, list
, tuple
, and dict
classes, as well as the collections
module.
>>> a = frozenset(range(10)) >>> a frozenset({0, 1, 2, 3, 4, 5, 6, 7, 8, 9}) >>> b = frozenset('I am a Pythoner') >>> b frozenset({'y', 'I', ' ', 'r', 't', 'm', 'h', 'o', 'a', 'e', 'n', 'P'})
>>> c = frozenset()
>>> c
frozenset()
The above is the detailed content of Detailed introduction to Python’s built-in frozenset function. For more information, please follow other related articles on the PHP Chinese website!