TristanSld

update and pop methods in sets

Jan 16th, 2014
78
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. a.update(["b","c","d"]) # a kümesine öğe ekler
  6. print a, "\n"
  7. a.update(b) # veya a |= b
  8. print a, "\n"
  9. a.pop() # kümeden rastgele bir öğe siler
  10. print a
RAW Paste Data