- 趣味数学和Python编程
- 赵乘骥编著
- 147字
- 2025-02-25 16:52:07
7.1 Python的对象类型之集合
Python中有一种数据类型叫集合(Set),这是一些唯一的、不可变的对象的一个无序集合,这些对象支持与数学集合理论相对应的操作,比如求交集、并集。在Python的Console中,我们可以实验如下的集合操作。

集合上还有一些函数操作,比如add()、remove()、update()、intersection(),这些函数的含义如表7-1所示。
表7-1 函数及含义
