create account

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

View this thread on: hive.blogpeakd.comecency.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)
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
last_payout2019-08-21 18:06:51
cashout_time1969-12-31 23:59:59
total_payout_value10.111 HBD
curator_payout_value3.200 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length3,617
author_reputation73,919,354,200,140
root_title"all () Fonksiyonu - Python Dersleri (Tutorials)"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id89,527,574
net_rshares39,589,618,877,544
author_curate_reward""
vote details (61)
@bid4joy ·
re-elektroyazilim-all-fonksiyonu-python-dersleri-tutorials-20190818t001121165z
You got a 28.57% upvote from @bid4joy courtesy of @elektroyazilim!
properties (22)
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
last_payout2019-08-25 00:11:21
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_length67
author_reputation11,746,524,585,557
root_title"all () Fonksiyonu - Python Dersleri (Tutorials)"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id89,647,749
net_rshares0
@brupvoter ·
re-elektroyazilim-all-fonksiyonu-python-dersleri-tutorials-20190818t043612307z
You got a 65.79% upvote from @brupvoter courtesy of @elektroyazilim!
properties (22)
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
last_payout2019-08-25 04:36:54
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"all () Fonksiyonu - Python Dersleri (Tutorials)"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id89,653,332
net_rshares0
@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)
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
last_payout2019-08-24 13:28:24
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_length204
author_reputation308,134,181,812,267
root_title"all () Fonksiyonu - Python Dersleri (Tutorials)"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id89,631,830
net_rshares0
@luckyvotes ·
re-elektroyazilim-all-fonksiyonu-python-dersleri-tutorials-20190820t062622977z
You got a 93.21% upvote from @luckyvotes courtesy of @elektroyazilim!
properties (22)
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
last_payout2019-08-27 06:26:24
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"all () Fonksiyonu - Python Dersleri (Tutorials)"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id89,731,142
net_rshares0
@luckyvotes ·
re-elektroyazilim-all-fonksiyonu-python-dersleri-tutorials-20190820t084723497z
You got a 92.90% upvote from @luckyvotes courtesy of @elektroyazilim!
properties (22)
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
last_payout2019-08-27 08:47:24
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"all () Fonksiyonu - Python Dersleri (Tutorials)"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id89,734,500
net_rshares0
@minnowvotes ·
re-elektroyazilim-all-fonksiyonu-python-dersleri-tutorials-20190818t043513675z
You got a 96.06% upvote from @minnowvotes courtesy of @elektroyazilim!
properties (22)
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
last_payout2019-08-25 04:35:15
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"all () Fonksiyonu - Python Dersleri (Tutorials)"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id89,653,291
net_rshares0
@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)
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
last_payout2019-08-26 03:47:18
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"all () Fonksiyonu - Python Dersleri (Tutorials)"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id89,687,467
net_rshares0
@whalepromobot ·
re-elektroyazilim-all-fonksiyonu-python-dersleri-tutorials-20190818t003038272z
You got a 33.33% upvote from @whalepromobot courtesy of @elektroyazilim!
properties (22)
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
last_payout2019-08-25 00:30:45
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_length73
author_reputation-231,775,391,844
root_title"all () Fonksiyonu - Python Dersleri (Tutorials)"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id89,648,103
net_rshares0