- Manual
- 直译
- 实例
- Note
- 拓展阅读
Manual
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.
直译
可根据iterable获得元素,返回一个frozenset对象,frozenset是内建类,详情见frozenset和Set类型 — set, frozenset
实例
>>> a =
[1, 1, 2, 3, 5, 7, 2]
>>> fs = frozenset(a)
>>> fs
frozenset({1, 2, 3, 5, 7})
Note
- frozenset集合元素必须可哈希
- 不可变性
拓展阅读
frozenset和Set类型 — set, frozenset
最后
以上就是发嗲钢笔最近收集整理的关于Python 内建函数 - frozenset([iterable])Manual直译实例Note拓展阅读的全部内容,更多相关Python内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复