all () Fonksiyonu - Python Dersleri (Tutorials) by elektroyazilim

View this thread on steempeak.com
· @elektroyazilim ·
$13.31
all () Fonksiyonu - Python Dersleri (Tutorials)
![yeni.jpg](https://cdn.steemitimages.com/DQmVqEHkajCZyuMfc1Nn7AfRj9QwYTddNmLcySkpi48PD1S/yeni.jpg) 

Merhabalar

Python programlama derslerinin bu bölümünde _all()_ fonksiyonundan bahsedeceğiz.

_all_  kelimesi Türkçede hepsi anlamına gelmektedir. _all()_ fonksiyonu da ismi ile benzer bir işleve sahiptir. 

_all()_ fonksiyonu, dizisel bir yapı içerisindeki tüm değerler _True_ ise  True değerini döndürürken, bu değerlerden herhangi biri _False_ olduğu durumda False değerini döndürür. _all()_ fonksiyonunun çalışma mantığı bu şekildedir.

_all()_ fonksiyonunun kullanımına geçmeden önce böyle bir uygulamayı fonksiyon olmadan nasıl yaparız görelim :

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

_all()_ fonksiyonunu kendimiz tanımlamış olsaydık yukarıdakine benzer bir fonksiyon oluşturmamız gerekirdi. Fonksiyonumuz parametre olarak bir liste almaktadır.

Fonksiyona parametre olarak gelen _liste,_ fonksiyon bloğu içerisinde  bir _for()_ döngüsüne girecektir. Bu döngüde her bir liste elemanı içerisinde gezinip, değerinin _False_ olup olmadığı sorgulanmaktadır.

Bu sorgu _if()_ yapısı içerisinde yapılmaktadır.

> not item

ifadesi _True_ ise if yapısına girilecek ve 

> return False

ifadesi ile fonksiyondan çıkılacaktır. Girilmediği takdirde de

> return True

kodu ile fonksiyondan çıkılacaktır. Yani fonksiyonun _False_ döndürebilmesi için içerisinde bir tane bile _False_ değer olması yeterlidir.

Şimdi de yazmış olduğumuz fonksiyonu çalıştıralım :

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

Fonksiyonu 2 adet liste üzerinde test ettik. İlk listemiz :

> myList = [True, False, True, True, True]

listesidir. İçerisinde bir adet _False_ değeri vardır. Bu durumda kendi tanımladığımız _hepsi()_ False değer döndürmelidir ki döndürdü de.

İkinci tanımladığımız liste ise

> myList2 = [True, True, True, True, True]

listesidir. Tüm elemanları _True_ değere sahiptir ve bu durumda _hepsi()_ fonksiyonunun True değer döndürmesi gerekir. Döndürdü.

_hepsi()_ fonksiyonunu şimdi de sayı değerleri üzerinde test edelim. Ancak öncelikle şunu belirteyim. Sayı değerleri, sıfır haricinde hep True döndürür, sadece 0(sıfır) değerinde False döndürür.

Herhangi iki adet sayı listesi oluşturalım ve sonuca bakalım :

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

Görüldüğü gibi nagetif değerler de dahil tüm sayı değerleri True kabul edildiğinden ilk listemiz True döndürürken,  içerisinde 0(sıfır) elemanı bulunan liste False değer döndürdü.

Şimdi de bu değerleri _all()_ fonksiyonunun kendinde test edelim. Böylelikle kullanımını da görmüş oluruz :

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

_all()_ fonksiyonunun kullanımı örneklerde görüldüğü gibi oldukça basit. _all()_ fonksiyonunu, string diziler üzerinde de kullanabiliriz :

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

Örneklere baktığınızda eminim fark etmişsinizdir. string değerlerin içeriği dolu ise bu değerleri _True_ kabul ederken, içeriği boş olan string değer _False_ kabul edildiğinden sonuç False dönmüştür.


Ş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>
👍  , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,
properties (23)
post_id79,056,870
authorelektroyazilim
permlinkall-fonksiyonu-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\/DQmPTdgBKbwUT5HDpmpDBzqmjmGXw1Rmvd8a6BiWfE1C3dT\/image.png","https:\/\/cdn.steemitimages.com\/DQmef8ZFRLzC9Dzydxn1hXHe6xsqycVPZvc57fzPv2yDYYa\/image.png","https:\/\/cdn.steemitimages.com\/DQmVgP4hd5FeCikMNqCBtJJiLCBpoNTVtxSD1Mh93BwpJUD\/image.png","https:\/\/cdn.steemitimages.com\/DQmTNVN3QG3T1xzHWjPXVU4ZvXgmgcjWK4pwb38reJxj8U4\/image.png","https:\/\/cdn.steemitimages.com\/DQmUv8B6j2s82SiGLxrKX8bzwdi91rUAj6DWHc7ek5Dgv8p\/image.png","https:\/\/cdn.steemitimages.com\/DQmYZw2bhUomeivJwQ8CiLaTzXTbJPLd1PsSGdcoEE1DfKP\/yesilayrca.png"],"app":"marlians\/0.1","format":"markdown"}
created2019-08-14 18:06:51
last_update2019-08-14 18:06:51
depth0
children8
net_rshares39,589,618,877,544
last_payout2019-08-21 18:06:51
cashout_time1969-12-31 23:59:59
total_payout_value10.111 SBD
curator_payout_value3.200 SBD
pending_payout_value0.000 SBD
promoted0.000 SBD
body_length3,617
author_reputation73,941,607,658,612
root_title"all () Fonksiyonu - Python Dersleri (Tutorials)"
beneficiaries[]
max_accepted_payout1,000,000.000 SBD
percent_steem_dollars10,000
author_curate_reward""
vote details (61)
@joeparys ·
re-elektroyazilim-all-fonksiyonu-python-dersleri-tutorials-20190817t132823828z
You got a 21.05% upvote from @joeparys! Thank you for your support of our services. To continue your support, please follow and delegate Steem power to @joeparys for daily steem and steem dollar payouts!
properties (22)
post_id79,150,683
authorjoeparys
permlinkre-elektroyazilim-all-fonksiyonu-python-dersleri-tutorials-20190817t132823828z
categorypalnet
json_metadata{"app":"postpromoter\/2.1.1"}
created2019-08-17 13:28:24
last_update2019-08-17 13:28:24
depth1
children0
net_rshares0
last_payout2019-08-24 13:28:24
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_length204
author_reputation271,922,061,735,735
root_title"all () Fonksiyonu - Python Dersleri (Tutorials)"
beneficiaries[]
max_accepted_payout1,000,000.000 SBD
percent_steem_dollars10,000
@bid4joy ·
re-elektroyazilim-all-fonksiyonu-python-dersleri-tutorials-20190818t001121165z
You got a 28.57% upvote from @bid4joy courtesy of @elektroyazilim!
properties (22)
post_id79,165,138
authorbid4joy
permlinkre-elektroyazilim-all-fonksiyonu-python-dersleri-tutorials-20190818t001121165z
categorypalnet
json_metadata{"app":"postpromoter\/2.1.1"}
created2019-08-18 00:11:21
last_update2019-08-18 00:11:21
depth1
children0
net_rshares0
last_payout2019-08-25 00:11:21
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_length67
author_reputation11,748,975,549,395
root_title"all () Fonksiyonu - Python Dersleri (Tutorials)"
beneficiaries[]
max_accepted_payout1,000,000.000 SBD
percent_steem_dollars10,000
@whalepromobot ·
re-elektroyazilim-all-fonksiyonu-python-dersleri-tutorials-20190818t003038272z
You got a 33.33% upvote from @whalepromobot courtesy of @elektroyazilim!
properties (22)
post_id79,165,457
authorwhalepromobot
permlinkre-elektroyazilim-all-fonksiyonu-python-dersleri-tutorials-20190818t003038272z
categorypalnet
json_metadata{"app":"postpromoter\/2.0.0"}
created2019-08-18 00:30:45
last_update2019-08-18 00:30:45
depth1
children0
net_rshares0
last_payout2019-08-25 00:30: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_length73
author_reputation-231,443,210,169
root_title"all () Fonksiyonu - Python Dersleri (Tutorials)"
beneficiaries[]
max_accepted_payout1,000,000.000 SBD
percent_steem_dollars10,000
@minnowvotes ·
re-elektroyazilim-all-fonksiyonu-python-dersleri-tutorials-20190818t043513675z
You got a 96.06% upvote from @minnowvotes courtesy of @elektroyazilim!
properties (22)
post_id79,170,210
authorminnowvotes
permlinkre-elektroyazilim-all-fonksiyonu-python-dersleri-tutorials-20190818t043513675z
categorypalnet
json_metadata{"app":"postpromoter\/2.1.1"}
created2019-08-18 04:35:15
last_update2019-08-18 04:35:15
depth1
children0
net_rshares0
last_payout2019-08-25 04:35:15
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"all () Fonksiyonu - Python Dersleri (Tutorials)"
beneficiaries[]
max_accepted_payout1,000,000.000 SBD
percent_steem_dollars10,000
@brupvoter ·
re-elektroyazilim-all-fonksiyonu-python-dersleri-tutorials-20190818t043612307z
You got a 65.79% upvote from @brupvoter courtesy of @elektroyazilim!
properties (22)
post_id79,170,240
authorbrupvoter
permlinkre-elektroyazilim-all-fonksiyonu-python-dersleri-tutorials-20190818t043612307z
categorypalnet
json_metadata{"app":"postpromoter\/2.1.1"}
created2019-08-18 04:36:54
last_update2019-08-18 04:36:54
depth1
children0
net_rshares0
last_payout2019-08-25 04:36:54
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_length69
author_reputation13,663,298,473,304
root_title"all () Fonksiyonu - Python Dersleri (Tutorials)"
beneficiaries[]
max_accepted_payout1,000,000.000 SBD
percent_steem_dollars10,000
@redlambo ·
re-elektroyazilim-all-fonksiyonu-python-dersleri-tutorials-20190819t034719743z
You got a 25.00% upvote from @redlambo courtesy of @elektroyazilim! Make sure to use tag #redlambo to be considered for the curation post!
properties (22)
post_id79,200,999
authorredlambo
permlinkre-elektroyazilim-all-fonksiyonu-python-dersleri-tutorials-20190819t034719743z
categorypalnet
json_metadata{"app":"postpromoter\/1.9.2"}
created2019-08-19 03:47:18
last_update2019-08-19 03:47:18
depth1
children0
net_rshares0
last_payout2019-08-26 03:47:18
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_length139
author_reputation123,026,877,081
root_title"all () Fonksiyonu - Python Dersleri (Tutorials)"
beneficiaries[]
max_accepted_payout1,000,000.000 SBD
percent_steem_dollars10,000
@luckyvotes ·
re-elektroyazilim-all-fonksiyonu-python-dersleri-tutorials-20190820t062622977z
You got a 93.21% upvote from @luckyvotes courtesy of @elektroyazilim!
properties (22)
post_id79,240,232
authorluckyvotes
permlinkre-elektroyazilim-all-fonksiyonu-python-dersleri-tutorials-20190820t062622977z
categorypalnet
json_metadata{"app":"postpromoter\/2.1.2"}
created2019-08-20 06:26:24
last_update2019-08-20 06:26:24
depth1
children0
net_rshares0
last_payout2019-08-27 06:26:24
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_length70
author_reputation29,361,468,835
root_title"all () Fonksiyonu - Python Dersleri (Tutorials)"
beneficiaries[]
max_accepted_payout1,000,000.000 SBD
percent_steem_dollars10,000
@luckyvotes ·
re-elektroyazilim-all-fonksiyonu-python-dersleri-tutorials-20190820t084723497z
You got a 92.90% upvote from @luckyvotes courtesy of @elektroyazilim!
properties (22)
post_id79,243,187
authorluckyvotes
permlinkre-elektroyazilim-all-fonksiyonu-python-dersleri-tutorials-20190820t084723497z
categorypalnet
json_metadata{"app":"postpromoter\/2.1.2"}
created2019-08-20 08:47:24
last_update2019-08-20 08:47:24
depth1
children0
net_rshares0
last_payout2019-08-27 08:47:24
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_length70
author_reputation29,361,468,835
root_title"all () Fonksiyonu - Python Dersleri (Tutorials)"
beneficiaries[]
max_accepted_payout1,000,000.000 SBD
percent_steem_dollars10,000