集合:
set:数据是唯一的,无序的
in 或 not in 来判断数据是否存在在集合中
num = {1,32,3}
>>> type(num)
<type 'set'>
添加数据:
num.add(9)
>>> num
set([1, 2, 3, 4, 9])
冻结集合:不能再先 add来添加数据了
numes = frozenset([1,2,3])
集合:
set:数据是唯一的,无序的
in 或 not in 来判断数据是否存在在集合中
num = {1,32,3}
>>> type(num)
<type 'set'>
添加数据:
num.add(9)
>>> num
set([1, 2, 3, 4, 9])
冻结集合:不能再先 add来添加数据了
numes = frozenset([1,2,3])