Advertisement
TristanSld

keys, values, pop and popitem methods in dictionaries

Jan 10th, 2014
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.34 KB | None | 0 0
  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
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement