a = set([1,2,3,4,5]) b = set([4,5,6,7,8])
交集
print(‘交集‘) print(a.intersection(b)) print(a & b)
并集
差集
Python set集合
原文:https://www.cnblogs.com/actiontry/p/10247381.html