#Author:ge jian
list_1=[1,2,6,7,4,6,9,3,4,5,8,2,7,1]
list_1=set(list_1)#集合
list_2=set([1,3,4,55,66,77,8,9,3])
print(list_1.intersection(list_2))#交集
print(list_1.union(list_2))#并集
print(list_1.difference(list_2))#差集in line1 not in line2
print(list_1,type(list_1))
print(list_1.issubset(list_2))#是否属于line2子集
print(list_1.issuperset(list_2))#父集
#反向差集
print(list_1.symmetric_difference(list_2))
转载于:https://www.cnblogs.com/gejian1991/p/8407278.html