Python frozenset
来源:互联网 发布:淘宝app确认订单页面 编辑:程序博客网 时间:2024/06/13 13:43
用法:frozenset([iterable])
定义:返回一个冻结的集合,冻结后的集合不能添加或删除函数
示例:
>>> list = ['a','b','c','d','e','f','a','b','c'] >>> print(len(list),list)9 ['a', 'b', 'c', 'd', 'e', 'f', 'a', 'b', 'c']>>> set = frozenset(list)>>> print(len(set),set)6 frozenset({'a', 'b', 'c', 'e', 'd', 'f'})>>> set.add('g')Traceback (most recent call last): File "<stdin>", line 1, in <module>AttributeError: 'frozenset' object has no attribute 'add'
阅读全文
0 0
- Python frozenset
- python: set frozenset
- python:set和frozenset
- 【Python】set和frozenset
- Python 中的 set 与 frozenset
- 【Python】set与frozenset的区别
- Python标准库:内置函数frozenset([iterable])
- 【Python】set与frozenset的区别
- Python集合set与frozenset的区别
- python字典和集合,frozenset和哈希值
- 【Python】set与frozenset的区别
- python中set与frozenset区别整合
- 【Python】set与frozenset的区别
- python中set和frozenset详解
- Python中的集合:set与frozenset用法举例
- Python中的集合:set与frozenset用法举例
- python中set和frozenset方法和区别
- python中set和frozenset方法和区别
- 收集宝石
- 2D 激光雷达扫描匹配的方法
- zabbix监控sersync
- Ubuntu设置防火墙端口
- 线性表归并运算
- Python frozenset
- Protocol Buffers 在游戏中的应用
- LeetCode-jump-game-ii
- intellij idea十个常用快捷键
- Oracle---备份(backup)
- Js中<%=%>是做什么的
- Maven——maven配置与Myeclipse创建maven项目
- JZOJ5394. 【NOIP2017提高A组模拟10.5】Ping 树上差分 树状数组
- BeanFactory not initialized or already closed