TristanSld

symmetric_difference method in sets

Jan 16th, 2014
75
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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
RAW Paste Data