setA = set('asdfghjkl') setB = set('qweasdzxc') print("setA为 {}\nsetB为 {}".format(setA, setB)) print("交集为 {}\n并集为 {}\n差集为 {}".format(setA.intersection(setB), setA.union(setB), setA.difference(setB)))