Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # define sets
- x = set('python')
- y = set('powershell')
- print(x - y) # All the elements in x but not in y
- # union
- print(x | y) # Unique elements in x or y or both
- # intersection
- print(x & y) # Elements in both x and y
- print(x ^ y) # Elements in x or y but not in both
Add Comment
Please, Sign In to add comment