set_intersection.py 192 Bytes
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
def report(s):
    l = list(s)
    l.sort()
    print(l)

s = {1, 2, 3, 4}
report(s)
report(s.intersection({1, 3}))
report(s.intersection([3, 4]))

print(s.intersection_update([1]))
report(s)