Guest User

Untitled

a guest
Apr 20th, 2018
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.26 KB | None | 0 0
  1. # define sets
  2. x = set('python')
  3. y = set('powershell')
  4.  
  5. print(x - y) # All the elements in x but not in y
  6. # union
  7. print(x | y) # Unique elements in x or y or both
  8. # intersection
  9. print(x & y) # Elements in both x and y
  10. print(x ^ y) # Elements in x or y but not in both
Add Comment
Please, Sign In to add comment