list1=[1,5,6,1,8,1,6,7,9,1,6]
list1 = set(list1)
list2 = set([1,6,88,44,66,33,9])
list3=set([1,6])
list4=set([11,61])
# print(list1,type(list1))
print(list1,list2)
#交集
print(list1.intersection(list2))
print((list1 & list2))
#并集
print(list1.union(list2))
print(list1 | list2)
#差集
print(list1.difference(list2))
print(list2.difference(list1))
print(list1 - list2)
print(list2 - list1)
#子集
print(list3.issubset(list2))
print(list1.issubset(list3))
print(list1.issuperset(list3))
print(list2.issuperset(list1))
#对称差集
print(list1.symmetric_difference(list2))
print(list1 ^ list2)
#""" Return True if two sets have a null intersection. """
print(list1.isdisjoint(list4))
print(list1.isdisjoint(list3))
#添加
list1.add('8999')
print(list1)
#添加多项
list1.update([777,888,555])
print(list1)
#len 长度
print(len(list1))
#删除
list1.remove('8999')
print(list1)
list1.discard(777)
print(list1)