 Merhabalar Python programlama derslerinin bu bölümünde gömülü fonksiyonlardan biri olan _filter()_ fonksiyonundan devam edeceğiz. _filter()_ fonksiyonu, parametre olarak aldığı fonksiyonun işlevine göre liste elemanlarını filtreler. ## Asal Sayı Bulma _filter()_ fonksiyonunu kullanarak verilen bir listedeki asal sayıları bulalım. _filter()_ kullanımına geçmeden önce ilk olarak _filter()_ fonksiyonuna parametre olarak gidecek olan _asal sayı bulan_ fonksiyonu tanımlayalım :  _asalMi()_ fonksiyonu aldığı sayının asal olup olmadığı bilgisini True veya False olarak döndüren bir fonksiyondur. Fonksiyonun içinde 1 adet _if elif_ yapısı içerisinde 3 durum sorgulanmıştır: * Gelen sayının 1 olma durumu ki bu Matematikte de özel bir durumdur. 1 sayısı kendinden ver 1 den başka sayıya bölünmemesine rağmen asal bir sayı değildir. Bu sebeple _False_ döndürülmüştür. * 2.durum ise gelen sayının 2 ye eşit olmama durumudur. 2 sayısı, Matematikte en küçük asal sayı kabul edilir. Bu sebeple _True_ döndürmüştür. * Son durum ise gelen sayının 1 ve 2 dışında olması durumudur. Bunda da _while()_ döngüsü içerisinde tek tek gelen sayının bölenleri sorgulanmıştır. Bir böleni çıksa dahi _while()_ döngüsü içerisindeki _if()_ yapısına girerek _False_ değeri döndürecektir. Girmese de _True_ döndürecektir. Uygulamamızın test sonuçları aşağıdaki gibidir :  Şimdi bu fonksiyonu _filter()_ fonksiyonu içerisinde kullanalım :  _filter()_ fonksiyonunun kullanımı oldukça basit. İlk parametreye fonksiyonu, ikinci parametreye liste veya demet gibi dizisel bir yapıyı veriyoruz. Sonrası ise sadece çalıştırmaya kalıyor. Sonuç görüldüğü gibi > [2, 3, 17, 167] dir. Programcıya çok pratiklik kazandırdığı anlaşılıyor sanırım. _filter()_ fonksiyonuna manuel liste verebileceğimiz gibi _range()_ fonksiyonu ile sıralı bir sayı dizisi de verebiliriz. Uygulamasını görelim :  _renge()_ fonksiyonu ile 1 den 37 ye kadar olan sayılar arasında _asal sayı_ araması yapıldı ve sonuç çıktıdaki gibidir. > Son eleman dahil değildir. Şimdilik bu kadar. Umarım faydalı bir çalışma olmuştur. Teşekkürler.  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>
author | elektroyazilim |
---|---|
permlink | filter-fonksiyonu-2-python-dersleri-tutorials |
category | palnet |
json_metadata | {"tags":["palnet","zzan","stem","tr","programming","python","marlians"],"image":["https://cdn.steemitimages.com/DQmVqEHkajCZyuMfc1Nn7AfRj9QwYTddNmLcySkpi48PD1S/yeni.jpg","https://cdn.steemitimages.com/DQmZ3JW7FQurDQfweAPqte5MTW4TJpS8EZnAkNwDvnycnTw/image.png","https://cdn.steemitimages.com/DQmXGRG7xnRMLVrZaq4TRkdZdd7FbMBPBvYJDbRvGggfW5M/image.png","https://cdn.steemitimages.com/DQma9NG5imEUD7EKCMQaSA2pFGrzdP6d93pFabyr7fuQBUS/image.png","https://cdn.steemitimages.com/DQmX4BhD3cJLpj1EBqHYFHT75s25NUB7TXbzCuuu8S9B2An/image.png","https://cdn.steemitimages.com/DQmYZw2bhUomeivJwQ8CiLaTzXTbJPLd1PsSGdcoEE1DfKP/yesilayrca.png"],"app":"marlians/0.1","format":"markdown"} |
created | 2019-08-11 18:11:00 |
last_update | 2019-08-11 18:11:00 |
depth | 0 |
children | 6 |
last_payout | 2019-08-18 18:11:00 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 10.309 HBD |
curator_payout_value | 3.250 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 2,881 |
author_reputation | 73,919,354,200,140 |
root_title | "filter() fonksiyonu # 2 - Python Dersleri (Tutorials)" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 89,411,713 |
net_rshares | 40,175,787,424,077 |
author_curate_reward | "" |
voter | weight | wgt% | rshares | pct | time |
---|---|---|---|---|---|
alex2016 | 0 | 55,782,692 | 100% | ||
steemyoda | 0 | 3,443,436,750,272 | 25% | ||
steemitboard | 0 | 29,645,059,347 | 2% | ||
oxiecuador | 0 | 151,972,698 | 5% | ||
joeparys | 0 | 1,101,617,450,462 | 17.85% | ||
steinhammer | 0 | 585,438,277 | 20% | ||
awesome-gadgets | 0 | 1,630,541,843 | 100% | ||
mmmmkkkk311 | 0 | 1,465,404,887,992 | 27.82% | ||
abandi | 0 | 713,497,587 | 100% | ||
neokuduk | 0 | 12,936,648,062 | 100% | ||
best-strategy | 0 | 8,740,113,582 | 100% | ||
literaturk | 0 | 3,124,655,674 | 100% | ||
minnowvotes | 0 | 20,281,761,868,503 | 94.09% | ||
sudefteri | 0 | 9,477,345,259 | 100% | ||
akifane | 0 | 2,882,669,886 | 100% | ||
rasit | 0 | 411,052,302 | 100% | ||
maveraunnehr | 0 | 412,104,901 | 100% | ||
dailyhouston | 0 | 409,789,917 | 77.2% | ||
yusrizakaria | 0 | 3,833,579,942 | 10% | ||
luckyvotes | 0 | 2,146,345,203,290 | 96.97% | ||
brupvoter | 0 | 2,658,442,619,783 | 67.05% | ||
inciter | 0 | 5,203,152,448,765 | 64.27% | ||
informator | 0 | 2,064,502,026 | 13.91% | ||
soteyapanbot | 0 | 17,578,797,322 | 20% | ||
andrewma | 0 | 0 | 0.2% | ||
oceansbot | 0 | 107,598,434 | 77.2% | ||
thebot | 0 | 846,021,283,785 | 87.7% | ||
oceanwhale | 0 | 1,506,580,469,762 | 77.2% | ||
crabbot | 0 | 541,371,499 | 100% | ||
profitvote | 0 | 1,142,587,197,880 | 85.69% | ||
mozer | 0 | 1,656,975,053 | 30% | ||
lucky-robin | 0 | 322,361,074 | 100% | ||
ayisigi | 0 | 467,367,385 | 100% | ||
xmauron3 | 0 | 1,491,052,902 | 100% | ||
natur-pur | 0 | 801,951,704 | 100% | ||
kabasakal | 0 | 12,105,212,128 | 30% | ||
mojo4you | 0 | 338,987,211 | 100% | ||
maonx | 0 | 9,036,075,548 | 100% | ||
omeryetim | 0 | 111,761,588 | 30% | ||
tinyvoter | 0 | 4,547,084,089 | 40% | ||
iskenderk | 0 | 15,841,041,881 | 100% | ||
yusufyusuf | 0 | 60,144,082,868 | 100% | ||
cocukgelisimi | 0 | 5,816,133,756 | 100% | ||
denizcakmak | 0 | 21,463,577,492 | 100% | ||
apix | 0 | 101,057,283,049 | 100% | ||
elektroyazilim | 0 | 41,778,375,518 | 100% | ||
steem-fund | 0 | 3,304,672,391 | 100% | ||
canercanbolat | 0 | 542,223,304 | 100% | ||
cn-zzang | 0 | 257,584,478 | 2% | ||
online-24-7 | 0 | 216,735,124 | 100% | ||
curation.stem | 0 | 541,523,921 | 50% | ||
mk-pal-token | 0 | 1,165,545,232 | 55.34% | ||
mk-natrl-token | 0 | 274,824,932 | 13.91% | ||
mk-stem-token | 0 | 274,824,872 | 13.91% | ||
mk-gg-token | 0 | 274,824,854 | 13.91% | ||
mk-marlians-tkn | 0 | 274,824,723 | 13.91% | ||
mk-leo-token | 0 | 274,824,698 | 13.91% | ||
mk-int-token | 0 | 274,824,741 | 13.91% | ||
mk-jahm-token | 0 | 274,824,700 | 13.91% | ||
ekitap | 0 | 203,341,117 | 100% |
You got a 67.05% upvote from @brupvoter courtesy of @elektroyazilim!
author | brupvoter |
---|---|
permlink | re-elektroyazilim-filter-fonksiyonu-2-python-dersleri-tutorials-20190814t112626650z |
category | palnet |
json_metadata | {"app":"postpromoter/2.1.1"} |
created | 2019-08-14 11:26:27 |
last_update | 2019-08-14 11:26:27 |
depth | 1 |
children | 0 |
last_payout | 2019-08-21 11:26:27 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 69 |
author_reputation | 13,657,314,846,422 |
root_title | "filter() fonksiyonu # 2 - Python Dersleri (Tutorials)" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 89,515,014 |
net_rshares | 0 |
You got a 17.85% 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!
author | joeparys |
---|---|
permlink | re-elektroyazilim-filter-fonksiyonu-2-python-dersleri-tutorials-20190815t014756070z |
category | palnet |
json_metadata | {"app":"postpromoter/2.1.1"} |
created | 2019-08-15 01:47:54 |
last_update | 2019-08-15 01:47:54 |
depth | 1 |
children | 0 |
last_payout | 2019-08-22 01:47:54 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 204 |
author_reputation | 308,134,181,812,267 |
root_title | "filter() fonksiyonu # 2 - Python Dersleri (Tutorials)" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 89,540,928 |
net_rshares | 0 |
You got a 96.97% upvote from @luckyvotes courtesy of @elektroyazilim!
author | luckyvotes |
---|---|
permlink | re-elektroyazilim-filter-fonksiyonu-2-python-dersleri-tutorials-20190816t193814666z |
category | palnet |
json_metadata | {"app":"postpromoter/2.1.2"} |
created | 2019-08-16 19:38:15 |
last_update | 2019-08-16 19:38:15 |
depth | 1 |
children | 0 |
last_payout | 2019-08-23 19:38:15 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 70 |
author_reputation | 29,364,484,293 |
root_title | "filter() fonksiyonu # 2 - Python Dersleri (Tutorials)" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 89,608,524 |
net_rshares | 0 |
You got a 94.09% upvote from @minnowvotes courtesy of @elektroyazilim!
author | minnowvotes |
---|---|
permlink | re-elektroyazilim-filter-fonksiyonu-2-python-dersleri-tutorials-20190814t094334871z |
category | palnet |
json_metadata | {"app":"postpromoter/2.1.1"} |
created | 2019-08-14 09:43:36 |
last_update | 2019-08-14 09:43:36 |
depth | 1 |
children | 0 |
last_payout | 2019-08-21 09:43:36 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 71 |
author_reputation | -125,291,280,752 |
root_title | "filter() fonksiyonu # 2 - Python Dersleri (Tutorials)" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 89,511,627 |
net_rshares | 0 |
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/60x60/http://steemitboard.com/img/notifications/postallweek.png"></td><td>You published a post every day of the week</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)!
author | steemitboard |
---|---|
permlink | steemitboard-notify-elektroyazilim-20190812t033147000z |
category | palnet |
json_metadata | {"image":["https://steemitboard.com/img/notify.png"]} |
created | 2019-08-12 03:31:48 |
last_update | 2019-08-12 03:31:48 |
depth | 1 |
children | 0 |
last_payout | 2019-08-19 03:31:48 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 859 |
author_reputation | 38,975,615,169,260 |
root_title | "filter() fonksiyonu # 2 - Python Dersleri (Tutorials)" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 89,424,487 |
net_rshares | 0 |
The force is with you! You got a 25.00% upvote from @steemyoda courtesy of @elektroyazilim! http://ultraimg.com/images/2018/02/27/n8qb.gif
author | steemyoda |
---|---|
permlink | re-elektroyazilim-filter-fonksiyonu-2-python-dersleri-tutorials-20190815t200044422z |
category | palnet |
json_metadata | {"app":"postpromoter/2.0.0"} |
created | 2019-08-15 20:00:48 |
last_update | 2019-08-15 20:00:48 |
depth | 1 |
children | 0 |
last_payout | 2019-08-22 20:00:48 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 140 |
author_reputation | -1,181,563,121,002 |
root_title | "filter() fonksiyonu # 2 - Python Dersleri (Tutorials)" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 89,571,311 |
net_rshares | 0 |