python 进阶学习之15
来源:互联网 发布:剃头理发器软件 编辑:程序博客网 时间:2024/06/05 04:37
集合类型
set()和 frozenset()
>>> s=set('cheeseship')
>>> s=set('cheeseshop')
>>> s
set(['c', 'e', 'h', 'o', 'p', 's'])
>>> t=frozenset('bookshop')
>>> t
frozenset(['b', 'h', 'k', 'o', 'p', 's'])
>>> type(s)
<type 'set'>
>>> type(t)
<type 'frozenset'>
>>> len(s
... )
6
子集/超集
联合( | ) union()
交集( & ) intersection()
差补/相对补集( – ) difference()
对称差分( ^ ) symmetric_difference()
0 0
- python 进阶学习之15
- python 进阶学习之1
- python 进阶学习之2
- python 进阶学习之3
- python 进阶学习之4
- python 进阶学习之6
- python 进阶学习之7
- python 进阶学习之8
- python 进阶学习之9
- python 进阶学习之10
- python 进阶学习之11
- python 进阶学习之12
- python 进阶学习之13
- python 进阶学习之14
- python 进阶学习之5--入门练习题
- Python学习之路七---进阶知识
- python学习--进阶篇
- python 进阶学习
- Debug与Release版本的区别
- Android系统架构
- C语言编译原理
- 在WPF程序中使用摄像头兼谈如何使用AForge.NET控件
- How Many Tables 并查集+水题+hdu
- python 进阶学习之15
- Direct2D随笔2——在C#的WinForm环境下创建Gameloop
- POJ 2115 C Looooops
- hdu 1087 Super Jumping! Jumping! Jumping!(dp 最长上升子序列和)
- Django安装
- poj3422 来一道费用流
- Java对象的序列化和反序列化实践
- Windows Program Files 和 Program Files (x86) 的区别
- 小希的迷宫 并查集+hdu