Advertisement
here2share

# set_variances.py

Jul 3rd, 2017
191
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.22 KB | None | 0 0
  1. # set_variances.py
  2.  
  3. a = set([1,2,3,4])
  4. b = set([3,4,5,6])
  5. print a | b # Union
  6. # {1, 2, 3, 4, 5, 6}
  7. print a & b # Intersection
  8. # {3, 4}
  9. print a - b # Difference
  10. # {1, 2}
  11. print a ^ b # Symmetric Difference
  12. # {1, 2, 5, 6}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement