Python集合set()操做详解

在Python中 set是基本数据类型的一种集合类型,它有可变集合(set())和不可变集合(frozenset)两种。建立集合set、集合set添加、集合删除、交集、并集、差集的操做都是很是实用的方法。html 1、建立集合set python set类是在python的sets模块中 >>> s1 = set('boy') >>> print s1 set(['y', 'b', 'o'])  
相关文章
相关标签/搜索