集合操作

#coding=utf-8


m = {"a", "b", "c", "d"}
n = {"d", "e", "f", "b"}


#并集
p = m.union(n)
print p

#哪些不是共有元素
q = m.difference(n)
print q

#查找共同元素
r = m.intersection(n)
print r
原文地址:https://www.cnblogs.com/themost/p/9148731.html