Advertisement
TristanSld

dictionaries

Jan 10th, 2014
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.50 KB | None | 0 0
  1. #!/usr/bin/env python
  2. #-*-coding:utf-8-*-
  3. sozluk={}#sözlük oluşturmak
  4. print type(sozluk),"\n"
  5. dictionary={"elma":"meyve","domates":"sebze",1:"sayi"}#Burada elma anahtar meyve ise bu anahtarın değeridir.
  6. print dictionary,"\n"
  7. sozluk1={"Adana":"01","İstanbul":"34","İzmir":"35"}
  8. print len(sozluk1),"\n"
  9. telefon_defteri={"Ahmet":"0548 595 47 82",
  10. "Salih":"0538 685 48 54",
  11. "Selin":"0505 589 26 35"}
  12. print telefon_defteri, "\n"
  13. print telefon_defteri["Ahmet"] #sözlüklerde sıra kavramı yoktur.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement