Advertisement
TristanSld

symmetric_difference method in sets

Jan 16th, 2014
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.24 KB | None | 0 0
  1. #usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3. a=set([0,2,5,7])
  4. b=set([1,3,5,7,9])
  5. print a.symmetric_difference(b) or a ^ b, '\n' #a ve b kümesinin birbirinden farkları
  6. print a, "\n"
  7. a.symmetric_difference_update(b) # veya a ^= b
  8. print a
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement