1、创建集合
1 set1=set() #创建可变集合 2 set2=frozenset() 创建不可变集合
2、检测元素: in
3、集合操作
求交集: &、.intersection()
求并集: |、.union()
求差集: - 、.difference()
求异或集: ^ 、.symmetric_difference()
判断子集: <= 、.issubset()
判断真子集: <
判断超集: >=、.issuperset()
判断真超集:>
4、set方法
.add() 添加元素
.update() 添加另一个set的所有元素
.remove() 删除元素