取交集
s = 'abcdef'
b = 'bced'
结果:{'c', 'e', 'd', 'b'}
f =(set(s)).intersection(set(b))
取并集
f =(set(s)).union(set(b))
结果:{'d', 'e', 'f', 'c', 'b', 'a'}
取差集
f =(set(s)).difference(set(b))
结果:{'a', 'f'}
取交集
s = 'abcdef'
b = 'bced'
结果:{'c', 'e', 'd', 'b'}
f =(set(s)).intersection(set(b))
取并集
f =(set(s)).union(set(b))
结果:{'d', 'e', 'f', 'c', 'b', 'a'}
取差集
f =(set(s)).difference(set(b))
结果:{'a', 'f'}