1.差集
a = [1,2,3] b = [2,3] c = list(set(b).difference(set(a))) # b中有而a中没有的
2 .并集
c = list(set(a).union(set(b)))
3.交集
c=list(set(a).intersection(set(b)))
1.差集
a = [1,2,3] b = [2,3] c = list(set(b).difference(set(a))) # b中有而a中没有的
2 .并集
c = list(set(a).union(set(b)))
3.交集
c=list(set(a).intersection(set(b)))
本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。