TristanSld

keys, values, pop and popitem methods in dictionaries

Jan 10th, 2014
58
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/usr/bin/env python
  2. #-*-coding:utf-8-*-
  3. telefon_defteri={"Ahmet":"0533 123 54 58",
  4. "Salih":"0554 258 65 78", "Selin":"0546 589 23 59"}
  5. print telefon_defteri.keys(),"\n"
  6. print telefon_defteri.values(),"\n"
  7. print telefon_defteri.pop("Ahmet"),"\n"#ada gore oge siler
  8. print telefon_defteri,"\n"
  9. print telefon_defteri.popitem()#rastgele oge siler
RAW Paste Data