Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # set_variances.py
- a = set([1,2,3,4])
- b = set([3,4,5,6])
- print a | b # Union
- # {1, 2, 3, 4, 5, 6}
- print a & b # Intersection
- # {3, 4}
- print a - b # Difference
- # {1, 2}
- print a ^ b # Symmetric Difference
- # {1, 2, 5, 6}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement