Scroll Down to See All▾
absaiterallanextanyasciibinboolbreakpointbytearraybytescallablechrclassmethodcompilecomplexdelattrdictdivmodenumerateevalexecfilterfloatformatgetattrglobalshasattrhashhelphexidinputintisinstanceissubclassiterlenlistlocalsmapmaxmemoryviewminnextobjectoctopenordpowprintpropertyrangereprreversedroundsetsetattrslicesortedstaticmethodstrsumsupertupletypevarszip__import__clear_(dict)clear_(list)clear_(set)copy_(dict)copy_(list)copy_(set)fromkeysgetitemskeyspop_(dict)pop_(list)pop_(set)popitemsetdefaultupdatevaluescount_(tuple)count_(list)count_(str)index_(tuple)index_(list)index_(str)adddifferencedifference_updatediscardintersectionintersection_updateisdisjointissubsetissupersetremove_(set)remove_(list)symmetric_differencesymmetric_difference_updateunionupdateclosefilenoflushisattyreadreadablereadlinereadlinesseekseekabletelltruncatewritablewritewritelinesappendextendinsertreversesortcapitalizecasefoldcenterencodeendswithexpandtabsfindformatisalnumisalphaisasciiisdecimalisdigitisidentifierislowerisnumericisprintableisspaceistitleisupperjoinljustlowerlstripmaketranspartitionreplacerfindrindexrjustrpartitionrsplitrstripsplitsplitlinesstartswithstripswapcasetitletranslateupperdirzfillFunction Details: frozenset
Description
Returns an immutable set object initialized from iterable.
Extended Description
The frozenset() function returns an immutable set object. Like sets, frozensets are unordered collections of unique elements, but unlike sets, frozensets are immutable and hashable. This makes them suitable for use as dictionary keys or as elements of other sets. If no argument is passed, it returns an empty frozenset.
Exceptions
- TypeError: If the iterable contains unhashable objects
Read More about frozenset from Python Documentation
Function Signature
frozenset(iterable: Optional[Iterable] = None) -> frozenset
Module: builtins
Class: frozenset
Parameters
iterable: An optional iterable object (e.g., list, tuple, set) to initialize the frozenset. If omitted, returns an empty frozenset.
Parameter List
- iterable: Optional[Iterable]
Return
Returns a new frozenset object containing unique elements from the input iterable.
Return Type
frozenset
Output
Explanation
This example shows creating frozensets from a list with duplicates, a string, and an empty frozenset.