讲解python函数:frozenset集合函数入门及实例

函数作用
frozenset() 返回一个冻结的集合,冻结后集合不能再添加或删除任何元素。与之对应的是set函数,set无序排序且不重复,是可变的,有add(),remove()等方法。

函数原型
1
frozenset([iterable])
版本兼容性
Python3.x

= Python2.4
函数参数
iterable – 可迭代的对象,比如列表、字典、元组、字符串等等。
函数用法
根据参数给定的对象, 返回相应的不可变集合。
返回值
返回新的 frozenset 对象,如果不提供任何参数,默认会生成空集合。

英文解释
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.
For other containers see the built-in set, list, tuple, and dict classes, as well as the collections module.
实例
讲解python函数:frozenset集合函数入门及实例