create account

Kümeler (Sets) #2 - Python Dersleri (Tutorials) by elektroyazilim

View this thread on: hive.blogpeakd.comecency.com
· @elektroyazilim ·
$16.51
Kümeler (Sets) #2 - Python Dersleri (Tutorials)
![yeni.jpg](https://cdn.steemitimages.com/DQmVqEHkajCZyuMfc1Nn7AfRj9QwYTddNmLcySkpi48PD1S/yeni.jpg) 

Merhabalar

Python programlama derslerinin bu bölümünde kümeler konusundan devam edeceğiz.

> Bu ders önceki derste verilen bilgiler üzerine bina edilecektir. Bu sebeple öncelikle o derse bakmanız tavsiye edilir.

İngilizce ismiyle _sets_ olan kümeler, içerisinde birden fazla aynı değeri bulundurmayan veri tipleriydi. Başka veri tiplerini küme veri tipine _set()_ fonksiyonu ile dönüştürmek mümkündü.

Ancak bu dönüşümü yaparken oluşacak kümenin yine küme mantığı ile ortaya çıkacağını unutmamak gerekir. Yani bir liste içerisinde tekrarlı eleman varsa o listeden oluşacak küme de o tekrarlı elemanlara yer verilmeyecektir.

## for döngüsü ve kümeler

_for_ döngüsü de nihayetinde dizisel bir yapı olduğu için listelerde olduğu gibi _for()_ döngüsünü kullanarak küme elemanları içerisinde gezinebiliriz. 

Uygulamasını görelim :

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

Örneğimizde _for()_ döngüsünü kullanarak küme elemanları içerisinde gezinip değerleri ekrana yazdırdık. Ancak fark ettiğiniz üzere küme elemanları sıralı bir şekilde gelmedi.

> Kümeler sırasız olması özelliği bakımından sözlüklere benzemektedir.

Şimdi de küme elemanlarına index değerleri üzerinden erişip erişemiyeceğimizi görelim:

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

Kümelere indexlerle ulaşamayacağımıza dair bir hata aldık. Fark ettiğiniz üzere ,

> Küme elemanlarına direk bir erişim söz konusu değil.

Bu şekilde bir erişim söz konusu olmasa da küme elemanlarına bir _for()_ döngüsü üzerinden erişebiliriz. 

Ya da kümeyi listeye çevirirsek elemanlarına da index değerleri üzerinden erişebiliriz. Uygulamasını görelim :

![](https://cdn.steemitimages.com/DQmTUX82jpPoMs6F6NV75B1ELw29KdwDRutqdcQfLnYqtY5/image.png)
 
Örneğimizde _langs_ kümesini _list()_  fonksiyonunu kullanarak bir listeye çevirdik ve sonrasında index değerleri üzerinden yeni listenin elemanlarına erişim sağlayabildik.

Ş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

<hr><center><sub>Posted via <a href="https://www.marlians.com/">Marlians.com</a></sub></center>
👍  , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , and 9 others
properties (23)
authorelektroyazilim
permlinkkuemeler-sets-2-python-dersleri-tutorials
categorypalnet
json_metadata{"tags":["palnet","zzan","stem","tr","programming","python","marlians"],"image":["https://cdn.steemitimages.com/DQmVqEHkajCZyuMfc1Nn7AfRj9QwYTddNmLcySkpi48PD1S/yeni.jpg","https://cdn.steemitimages.com/DQmYqVmh98kBf8JvBeDwqjBevG62ykWkaBvCHK1x9igGAZR/image.png","https://cdn.steemitimages.com/DQmUqkdP22ihcVngC1UT5ZMid1fYtTTvmt7ys5HgG48qkds/image.png","https://cdn.steemitimages.com/DQmTUX82jpPoMs6F6NV75B1ELw29KdwDRutqdcQfLnYqtY5/image.png","https://cdn.steemitimages.com/DQmYZw2bhUomeivJwQ8CiLaTzXTbJPLd1PsSGdcoEE1DfKP/yesilayrca.png"],"links":["https://www.marlians.com/"],"app":"marlians/0.1","format":"markdown"}
created2019-08-19 18:26:12
last_update2019-08-19 18:26:12
depth0
children6
last_payout2019-08-26 18:26:12
cashout_time1969-12-31 23:59:59
total_payout_value12.534 HBD
curator_payout_value3.974 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length2,466
author_reputation73,919,354,200,140
root_title"Kümeler (Sets) #2 - Python Dersleri (Tutorials)"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id89,713,748
net_rshares49,166,227,949,748
author_curate_reward""
vote details (73)
@brupvoter ·
re-elektroyazilim-kuemeler-sets-2-python-dersleri-tutorials-20190822t051335696z
You got a 65.79% upvote from @brupvoter courtesy of @elektroyazilim!
properties (22)
authorbrupvoter
permlinkre-elektroyazilim-kuemeler-sets-2-python-dersleri-tutorials-20190822t051335696z
categorypalnet
json_metadata{"app":"postpromoter/2.1.1"}
created2019-08-22 05:13:36
last_update2019-08-22 05:13:36
depth1
children0
last_payout2019-08-29 05:13:36
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length69
author_reputation13,657,314,846,422
root_title"Kümeler (Sets) #2 - Python Dersleri (Tutorials)"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id89,810,431
net_rshares0
@edensgarden ·
re-elektroyazilim-kuemeler-sets-2-python-dersleri-tutorials-20190824t010636768z
Thanks for using @edensgarden!
properties (22)
authoredensgarden
permlinkre-elektroyazilim-kuemeler-sets-2-python-dersleri-tutorials-20190824t010636768z
categorypalnet
json_metadata{"app":"postpromoter/2.1.1"}
created2019-08-24 01:06:36
last_update2019-08-24 01:06:36
depth1
children0
last_payout2019-08-31 01:06:36
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length31
author_reputation-100,797,867,719
root_title"Kümeler (Sets) #2 - Python Dersleri (Tutorials)"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id89,883,104
net_rshares0
@luckyvotes ·
re-elektroyazilim-kuemeler-sets-2-python-dersleri-tutorials-20190824t091734135z
You got a 92.00% upvote from @luckyvotes courtesy of @elektroyazilim!
properties (22)
authorluckyvotes
permlinkre-elektroyazilim-kuemeler-sets-2-python-dersleri-tutorials-20190824t091734135z
categorypalnet
json_metadata{"app":"postpromoter/2.1.2"}
created2019-08-24 09:17:33
last_update2019-08-24 09:17:33
depth1
children0
last_payout2019-08-31 09:17:33
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length70
author_reputation29,364,484,293
root_title"Kümeler (Sets) #2 - Python Dersleri (Tutorials)"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id89,892,810
net_rshares0
@minnowvotes ·
re-elektroyazilim-kuemeler-sets-2-python-dersleri-tutorials-20190822t135135570z
You got a 94.72% upvote from @minnowvotes courtesy of @elektroyazilim!
properties (22)
authorminnowvotes
permlinkre-elektroyazilim-kuemeler-sets-2-python-dersleri-tutorials-20190822t135135570z
categorypalnet
json_metadata{"app":"postpromoter/2.1.1"}
created2019-08-22 13:51:36
last_update2019-08-22 13:51:36
depth1
children0
last_payout2019-08-29 13:51:36
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length71
author_reputation-125,291,280,752
root_title"Kümeler (Sets) #2 - Python Dersleri (Tutorials)"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id89,825,736
net_rshares0
@redlambo ·
re-elektroyazilim-kuemeler-sets-2-python-dersleri-tutorials-20190824t224141808z
You got a 50.00% upvote from @redlambo courtesy of @elektroyazilim! Make sure to use tag #redlambo to be considered for the curation post!
properties (22)
authorredlambo
permlinkre-elektroyazilim-kuemeler-sets-2-python-dersleri-tutorials-20190824t224141808z
categorypalnet
json_metadata{"app":"postpromoter/1.9.2"}
created2019-08-24 22:41:42
last_update2019-08-24 22:41:42
depth1
children0
last_payout2019-08-31 22:41:42
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length139
author_reputation123,143,757,359
root_title"Kümeler (Sets) #2 - Python Dersleri (Tutorials)"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id89,914,085
net_rshares0
@sneaky-ninja ·
re-elektroyazilim-kuemeler-sets-2-python-dersleri-tutorials-20190825t153504453z
![Sneaky-Ninja-Throwing-Coin 125px.jpg](https://cdn.steemitimages.com/DQmV3FB2y7KDREKaiCm8FqXJewWyA6he9f4nuMYX7CdFKH8/Sneaky-Ninja-Throwing-Coin%20125px.jpg)
Defended (29.41%)
Summoned by @elektroyazilim 
Sneaky Ninja supports @youarehope and @tarc with a percentage of all bids.
[Everything You Need To Know About Sneaky Ninja](https://steemit.com/steemit/@sneaky-ninja/everything-you-need-to-know-about-sneaky-ninja)
<br>
woosh
properties (22)
authorsneaky-ninja
permlinkre-elektroyazilim-kuemeler-sets-2-python-dersleri-tutorials-20190825t153504453z
categorypalnet
json_metadata{"app":"postpromoter/2.0.0"}
created2019-08-25 15:35:03
last_update2019-08-25 15:35:03
depth1
children0
last_payout2019-09-01 15:35:03
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length430
author_reputation6,929,108,306,933
root_title"Kümeler (Sets) #2 - Python Dersleri (Tutorials)"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id89,937,034
net_rshares0