Dictionary Veri Tipi # 1 - Python Dersleri (Tutorials) by elektroyazilim

View this thread on steempeak.com
· @elektroyazilim ·
$11.48
Dictionary Veri Tipi # 1 - Python Dersleri (Tutorials)
![kapak.jpg](https://cdn.steemitimages.com/DQmThdi5LSucjta2n6jp6kkyrJ1AgEhC3uAVRVVZaMzowQW/kapak.jpg)

Merhabalar. Python programlama derslerinin bu bölümünde yeni bir veri tipi olan Dictionary veri tipine giriş yapacağız.

Diğer programlama dillerindeki veri tiplerini düşündüğümüzde biraz daha farklı bir yere sahip olduğunu söyleyebiliriz.

Python derslerinde bugüne kadar gördüğümüz veri tiplerinden string , tuple veya listelere benzememektedir. Mesela liste veri tipinde, veri tipini oluşturan her bir elemanın kendine ait bir değeri varken, dictionary veri tipinde bu anahtar- değer ikilisi şeklindedir.

Anahtar- değer yapısı sayesinde aslında gerçek hayattaki sözlüklere de oldukça benzemektedir. Mesela bir ingilizce bir sözlüğü elimize alalım. Desk kelimesi böyle bir yapıda anahtar kelime ise Türkçe karşılığı olan Masa kelimesini bu anahtarın değeridir.

Şimdi bir sözlük nasıl oluşturulur, uygulama üzerinde görelim :

![](https://cdn.steemitimages.com/DQmQetevWesere4sYW5MRJjJT75hW4Ny5LZK7iLrJeraaxr/image.png)

Görüldüğü gibi bir sözlük oluştururken sözlük elemanları anahtar:değer çifti şeklinde verilmektedir. Diğer veri türlerinden farklı olarak süslü parantez { } kullanılıp çiftler birbirinden virgül ile ayrılmaktadır.

Şimdi oluşturduğumuz bu nesnenin tipini type() fonksiyonu kullanarak sorgulayalım :

![](https://cdn.steemitimages.com/DQmfSXba8mKeoEGjE2GrTwAmMFsG95sdGop3RiuPaxvynRi/image.png)

Sonucu "dict" olarak aldık. Görüldüğü gibi oluşturduğumuz sayilarDict nesnesi dict yani dictionary veri tipinde bir değişkendir.

Yukarıdaki örnekte 4 elemanlı bir sözlük örneği vermiştik. Şimdi de boş bir sözlük nasıl oluşturulur ona bakalım :

![](https://cdn.steemitimages.com/DQmZjwopT2ad2R1B3xp3STPMAUCfoxZbyPFENQ3rX9Gn84Z/image.png)

Boş bir dictionary oluşturmak için atama operatorunden sonra iki adet süslü parantez kullanmamız yeterli { }. Tabi bunun başka yolları da var yani metot kullanarak da boş bir dictionary oluşturabiliriz :

![](https://cdn.steemitimages.com/DQmbDPpfqEJpeC1g4F92zcTCZGk2E7wEiJvSLTxHwvmtKpR/image.png)

Örneğimizde dict() metodunuz kullanarak sozluk2 adında boş bir dictionary oluşturduk. 

Sözlük oluşturma ya da tanımlama işlemleri bu şekildedir.

Şimdilik bu kadar.

Umarım faydalı bir çalışma olmuştur.

Teşekkürler.

![yesilayrca.png](https://cdn.steemitimages.com/DQmYZw2bhUomeivJwQ8CiLaTzXTbJPLd1PsSGdcoEE1DfKP/yesilayrca.png)

Kaynak belirtilmeyen görseller bana aittir. The pictures without source in the post is belong to me
👍  , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,
properties (23)
post_id76,466,819
authorelektroyazilim
permlinkdictionary-veri-tipi-1-python-dersleri-tutorials
categoryblog
json_metadata{"tags":["blog","programming","python","tutorials"],"image":["https:\/\/cdn.steemitimages.com\/DQmThdi5LSucjta2n6jp6kkyrJ1AgEhC3uAVRVVZaMzowQW\/kapak.jpg","https:\/\/cdn.steemitimages.com\/DQmQetevWesere4sYW5MRJjJT75hW4Ny5LZK7iLrJeraaxr\/image.png","https:\/\/cdn.steemitimages.com\/DQmfSXba8mKeoEGjE2GrTwAmMFsG95sdGop3RiuPaxvynRi\/image.png","https:\/\/cdn.steemitimages.com\/DQmZjwopT2ad2R1B3xp3STPMAUCfoxZbyPFENQ3rX9Gn84Z\/image.png","https:\/\/cdn.steemitimages.com\/DQmbDPpfqEJpeC1g4F92zcTCZGk2E7wEiJvSLTxHwvmtKpR\/image.png","https:\/\/cdn.steemitimages.com\/DQmYZw2bhUomeivJwQ8CiLaTzXTbJPLd1PsSGdcoEE1DfKP\/yesilayrca.png"],"app":"steemit\/0.1","format":"markdown"}
created2019-06-16 06:23:39
last_update2019-06-16 06:23:39
depth0
children2
net_rshares19,801,676,778,340
last_payout2019-06-23 06:23:39
cashout_time1969-12-31 23:59:59
total_payout_value8.712 SBD
curator_payout_value2.769 SBD
pending_payout_value0.000 SBD
promoted0.000 SBD
body_length2,491
author_reputation73,941,607,658,612
root_title"Dictionary Veri Tipi # 1 - Python Dersleri (Tutorials)"
beneficiaries[]
max_accepted_payout1,000,000.000 SBD
percent_steem_dollars10,000
author_curate_reward""
vote details (54)
@steemitboard ·
Congratulations @elektroyazilim! You have completed the following achievement on the Steem blockchain and have been rewarded with new badge(s) :

<table><tr><td><img src="https://steemitimages.com/60x70/http://steemitboard.com/@elektroyazilim/posts.png?201906160747"></td><td>You published more than 60 posts. Your next target is to reach 70 posts.</td></tr>
</table>

<sub>_You can view [your badges on your Steem Board](https://steemitboard.com/@elektroyazilim) and compare to others on the [Steem Ranking](https://steemitboard.com/ranking/index.php?name=elektroyazilim)_</sub>
<sub>_If you no longer want to receive notifications, reply to this comment with the word_ `STOP`</sub>


To support your work, I also upvoted your post!


> You can upvote this notification to help all Steem users. Learn how [here](https://steemit.com/steemitboard/@steemitboard/http-i-cubeupload-com-7ciqeo-png)!
properties (22)
post_id76,470,851
authorsteemitboard
permlinksteemitboard-notify-elektroyazilim-20190616t080447000z
categoryblog
json_metadata{"image":["https:\/\/steemitboard.com\/img\/notify.png"]}
created2019-06-16 08:04:45
last_update2019-06-16 08:04:45
depth1
children0
net_rshares0
last_payout2019-06-23 08:04:45
cashout_time1969-12-31 23:59:59
total_payout_value0.000 SBD
curator_payout_value0.000 SBD
pending_payout_value0.000 SBD
promoted0.000 SBD
body_length894
author_reputation38,705,954,145,809
root_title"Dictionary Veri Tipi # 1 - Python Dersleri (Tutorials)"
beneficiaries[]
max_accepted_payout1,000,000.000 SBD
percent_steem_dollars10,000
@minnowvotes ·
re-elektroyazilim-dictionary-veri-tipi-1-python-dersleri-tutorials-20190620t192304419z
You got a 70.85% upvote from @minnowvotes courtesy of @elektroyazilim!
properties (22)
post_id76,734,176
authorminnowvotes
permlinkre-elektroyazilim-dictionary-veri-tipi-1-python-dersleri-tutorials-20190620t192304419z
categoryblog
json_metadata{"app":"postpromoter\/2.1.1"}
created2019-06-20 19:23:03
last_update2019-06-20 19:23:03
depth1
children0
net_rshares0
last_payout2019-06-27 19:23:03
cashout_time1969-12-31 23:59:59
total_payout_value0.000 SBD
curator_payout_value0.000 SBD
pending_payout_value0.000 SBD
promoted0.000 SBD
body_length71
author_reputation-300,453,853,020
root_title"Dictionary Veri Tipi # 1 - Python Dersleri (Tutorials)"
beneficiaries[]
max_accepted_payout1,000,000.000 SBD
percent_steem_dollars10,000