 Merhabalar Python programlama derslerinin bu bölümünde yine gömülü fonksiyonlardan biri olan _reduce()_ fonksiyonuna başlayacağız. _reduce()_ fonksiyonu da _map()_ fonksiyonu gibi ilk parametre olarak bir fonksiyon alır. Hatta genel yapısı birebir aynıdır, diyebiliriz:  _reduce()_ fonksiyonu ilk parametre olarak bir fonksiyon alırken ikinci parametre olarak içerisinde gezinebileceği dizisel bir yapı alır. Bu yapı liste, demet veya herhangi bir veri tipinden olabilir. _reduce()_ fonksiyonunun çalışma mantığı ise oldukça gariptir. Bir örnek üzerinden anlatayım. Dizisel elemanımızın bir liste olduğunu farz edelim. _reduce_ fonksiyonu parametre olarak aldığı fonksiyona listeden ilk iki elemanı fonksiyon parametresi olarak gönderir. Sonrasında fonksiyondan dönen sonuç ile beraber listenin bir sonraki elemanını tekrar aynı fonksiyona parametre olarak gönderir. Bu süreç listede eleman kalmayana kadar devam eder. Tanımdan çok bir şey anlaşılmayabilir, biz en iyisi uygulamasına geçelim:  Örneğimiz > from functools import reduce kodu ile başlamaktadır. _reduce()_ fonksiyonu, _functools_ modülünde tanımlıdır. Bu sebeple bu fonksiyonu kullanabilmek için programın başında böyle bir _import_ işlemi yapmamız gerekir. Sonrasında _carp()_ fonksiyonunu görüyoruz, iki parametre almaktadır. Aldığı parametreleri çarparak sonuç olarak döndürür. > reduce(carp,[1,2,3,4,5]) kodu ile fonksiyonu çalıştırıyoruz. _reduce()_ fonksiyonuna ilk olarak iki parametre gidecektir : 1 ve 2. Bu iki parametre _carp()_ fonksiyonuna gönderildikten sonra 1*2 = 2 olarak geri dönecektir. Sonrasında 2 sonucu elimizde tutularak listenin 3.elemanı olan 3 alınacaktır. Bu iki sayı da _carp()_ fonksiyonuna gönderildikten sonra 2 * 3 = 6 olarak geri döner. Tekrardan 6 ile beraber bu sefer 4.eleman olan 4 sayısı alınıp _carp()_ fonksiyonuna gönderilir. _carp()_ fonksiyonuna gönderilen 6 ve 4 parametreleri 6 * 4= 24 olarak geri döner. Son olarak 24 sayısı listenin 5.elemanı ile alınır ve tekrardan _carp()_ fonksiyonuna gönderilir ve listede başka eleman kalmadığından nihai değer elde edilir : 24 * 5 = 120 Sonucumuz 120'dir. Ş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
author | elektroyazilim |
---|---|
permlink | reduce-fonksiyonu-1-python-dersleri-tutorials |
category | palnet |
json_metadata | {"tags":["palnet","zzan","stem","tr","marlians","programming","python","realityhubs"],"image":["https://cdn.steemitimages.com/DQmVqEHkajCZyuMfc1Nn7AfRj9QwYTddNmLcySkpi48PD1S/yeni.jpg","https://cdn.steemitimages.com/DQmUGFGxpYA49hbxBYxVbrVVAmyhEjXiPTBqz8o6gWnY4LY/image.png","https://cdn.steemitimages.com/DQmUoiLLQHBVz7tx9pfGLQc6SautE8rVGApp5w9k35daM1x/image.png","https://cdn.steemitimages.com/DQmYZw2bhUomeivJwQ8CiLaTzXTbJPLd1PsSGdcoEE1DfKP/yesilayrca.png"],"app":"realityhubs/0.1","format":"markdown"} |
created | 2019-08-10 06:46:42 |
last_update | 2019-08-10 06:46:42 |
depth | 0 |
children | 9 |
last_payout | 2019-08-17 06:46:42 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 9.358 HBD |
curator_payout_value | 2.956 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 2,712 |
author_reputation | 73,919,354,200,140 |
root_title | "reduce Fonksiyonu # 1 - Python Dersleri (Tutorials)" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 89,359,957 |
net_rshares | 36,856,416,240,791 |
author_curate_reward | "" |
voter | weight | wgt% | rshares | pct | time |
---|---|---|---|---|---|
bert0 | 0 | 1,209,307,692 | 0.4% | ||
eforucom | 0 | 5,388,764,201 | 5% | ||
bukiland | 0 | 326,841,776 | 3.6% | ||
elviento | 0 | 1,515,258,602 | 1.1% | ||
sam99 | 0 | 6,390,146,573 | 4.6% | ||
lovejuice | 0 | 145,920,780,187 | 22.22% | ||
joeparys | 0 | 1,175,924,971,777 | 19.05% | ||
accelerator | 0 | 7,896,082,910 | 0.24% | ||
imisstheoldkanye | 0 | 2,315,434,509 | 1% | ||
steinhammer | 0 | 591,305,575 | 20% | ||
abandi | 0 | 706,711,699 | 100% | ||
neokuduk | 0 | 14,109,760,820 | 100% | ||
literaturk | 0 | 3,411,494,931 | 100% | ||
minnowvotes | 0 | 20,759,806,701,297 | 96.32% | ||
sudefteri | 0 | 10,410,866,978 | 100% | ||
akifane | 0 | 3,093,241,644 | 100% | ||
rasit | 0 | 452,819,101 | 100% | ||
bid4joy | 0 | 227,598,701,175 | 50% | ||
maveraunnehr | 0 | 453,967,236 | 100% | ||
dailyhouston | 0 | 410,206,825 | 77.27% | ||
redlambo | 0 | 300,956,976,886 | 50% | ||
luckyvotes | 0 | 2,136,129,474,255 | 96.53% | ||
ezravandi | 0 | 4,093,342,919 | 2.6% | ||
brupvoter | 0 | 2,663,031,561,289 | 67.01% | ||
inciter | 0 | 5,171,611,542,734 | 64.04% | ||
soteyapanbot | 0 | 17,425,602,715 | 20% | ||
oceansbot | 0 | 107,741,334 | 77.27% | ||
thebot | 0 | 843,126,884,536 | 87.42% | ||
oceanwhale | 0 | 1,506,286,122,208 | 77.27% | ||
crabbot | 0 | 546,215,716 | 100% | ||
profitvote | 0 | 1,124,795,842,466 | 84.37% | ||
kehuanmi | 0 | 596,163,273 | 100% | ||
whalecreator | 0 | 232,379,404,290 | 50% | ||
mozer | 0 | 1,666,672,720 | 30% | ||
tahirozgen | 0 | 83,845,926,748 | 90% | ||
lucky-robin | 0 | 319,092,124 | 100% | ||
whalepromobot | 0 | 207,204,578,682 | 50% | ||
voxmortis | 0 | 97,596,382 | 0.12% | ||
laissez-faire | 0 | 42,815,748 | 100% | ||
ayisigi | 0 | 504,363,337 | 100% | ||
kabasakal | 0 | 11,487,966,629 | 30% | ||
maonx | 0 | 9,036,075,548 | 100% | ||
omeryetim | 0 | 100,283,922 | 30% | ||
hdu | 0 | 4,122,775,197 | 2% | ||
iskenderk | 0 | 15,155,935,463 | 100% | ||
yusufyusuf | 0 | 60,585,173,845 | 100% | ||
cocukgelisimi | 0 | 5,933,482,884 | 100% | ||
bluesniper | 0 | 10,242,406,941 | 2.34% | ||
eternalsuccess | 0 | 722,444,435 | 1% | ||
denizcakmak | 0 | 20,201,423,387 | 100% | ||
restacked | 0 | 514,901,337 | 100% | ||
desulfurize | 0 | 236,012,209 | 100% | ||
gentianic | 0 | 512,159,045 | 100% | ||
elektroyazilim | 0 | 41,329,785,835 | 100% | ||
interzooecial | 0 | 517,858,184 | 100% | ||
interagent | 0 | 534,602,405 | 100% | ||
reproduce | 0 | 539,174,818 | 100% | ||
reeducated | 0 | 535,685,596 | 100% | ||
dwinf | 0 | 425,915,391 | 100% | ||
quenselite | 0 | 618,620,399 | 100% | ||
map10k | 0 | 4,067,339,541 | 0.52% | ||
vxc | 0 | 2,367,142,857 | 100% | ||
online-24-7 | 0 | 200,183,548 | 100% | ||
reversemagnetar | 0 | 682,872,527 | 100% | ||
mapxv | 0 | 4,664,013,733 | 0.92% | ||
reality.curate | 0 | -3,525,558,960 | -13% | ||
curation.rhb | 0 | 1,906,278,205 | 50% |
You got a 50.00% upvote from @bid4joy courtesy of @elektroyazilim!
author | bid4joy |
---|---|
permlink | re-elektroyazilim-reduce-fonksiyonu-1-python-dersleri-tutorials-20190812t124251268z |
category | palnet |
json_metadata | {"app":"postpromoter/2.1.1"} |
created | 2019-08-12 12:42:51 |
last_update | 2019-08-12 12:42:51 |
depth | 1 |
children | 0 |
last_payout | 2019-08-19 12:42:51 |
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 | 67 |
author_reputation | 11,746,524,585,557 |
root_title | "reduce Fonksiyonu # 1 - Python Dersleri (Tutorials)" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 89,437,441 |
net_rshares | 0 |
You got a 67.01% upvote from @brupvoter courtesy of @elektroyazilim!
author | brupvoter |
---|---|
permlink | re-elektroyazilim-reduce-fonksiyonu-1-python-dersleri-tutorials-20190812t062010351z |
category | palnet |
json_metadata | {"app":"postpromoter/2.1.1"} |
created | 2019-08-12 06:20:09 |
last_update | 2019-08-12 06:20:09 |
depth | 1 |
children | 0 |
last_payout | 2019-08-19 06:20:09 |
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 | "reduce Fonksiyonu # 1 - Python Dersleri (Tutorials)" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 89,428,197 |
net_rshares | 0 |
You got a 19.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!
author | joeparys |
---|---|
permlink | re-elektroyazilim-reduce-fonksiyonu-1-python-dersleri-tutorials-20190812t211401720z |
category | palnet |
json_metadata | {"app":"postpromoter/2.1.1"} |
created | 2019-08-12 21:14:00 |
last_update | 2019-08-12 21:14:00 |
depth | 1 |
children | 0 |
last_payout | 2019-08-19 21:14:00 |
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 | "reduce Fonksiyonu # 1 - Python Dersleri (Tutorials)" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 89,453,987 |
net_rshares | 0 |
This post has received a 22.22% upvote from @lovejuice thanks to @elektroyazilim. They love you, so does Aggroed. Please be sure to vote for Witnesses at https://steemit.com/~witnesses.
author | lovejuice |
---|---|
permlink | re-elektroyazilim-reduce-fonksiyonu-1-python-dersleri-tutorials-20190813t005701500z |
category | palnet |
json_metadata | {"app":"postpromoter/1.7.4"} |
created | 2019-08-13 00:57:00 |
last_update | 2019-08-13 00:57:00 |
depth | 1 |
children | 0 |
last_payout | 2019-08-20 00:57:00 |
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 | 185 |
author_reputation | 10,538,740,461,622 |
root_title | "reduce Fonksiyonu # 1 - Python Dersleri (Tutorials)" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 89,459,348 |
net_rshares | 0 |
You got a 96.53% upvote from @luckyvotes courtesy of @elektroyazilim!
author | luckyvotes |
---|---|
permlink | re-elektroyazilim-reduce-fonksiyonu-1-python-dersleri-tutorials-20190815t143918281z |
category | palnet |
json_metadata | {"app":"postpromoter/2.1.2"} |
created | 2019-08-15 14:39:18 |
last_update | 2019-08-15 14:39:18 |
depth | 1 |
children | 0 |
last_payout | 2019-08-22 14:39:18 |
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 | "reduce Fonksiyonu # 1 - Python Dersleri (Tutorials)" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 89,560,983 |
net_rshares | 0 |
You got a 96.32% upvote from @minnowvotes courtesy of @elektroyazilim!
author | minnowvotes |
---|---|
permlink | re-elektroyazilim-reduce-fonksiyonu-1-python-dersleri-tutorials-20190813t123634894z |
category | palnet |
json_metadata | {"app":"postpromoter/2.1.1"} |
created | 2019-08-13 12:36:36 |
last_update | 2019-08-13 12:36:36 |
depth | 1 |
children | 0 |
last_payout | 2019-08-20 12:36: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 | "reduce Fonksiyonu # 1 - Python Dersleri (Tutorials)" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 89,476,491 |
net_rshares | 0 |
You got a 50.00% upvote from @redlambo courtesy of @elektroyazilim! Make sure to use tag #redlambo to be considered for the curation post!
author | redlambo |
---|---|
permlink | re-elektroyazilim-reduce-fonksiyonu-1-python-dersleri-tutorials-20190813t131451053z |
category | palnet |
json_metadata | {"app":"postpromoter/1.9.2"} |
created | 2019-08-13 13:14:51 |
last_update | 2019-08-13 13:14:51 |
depth | 1 |
children | 0 |
last_payout | 2019-08-20 13:14:51 |
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 | 139 |
author_reputation | 123,143,757,359 |
root_title | "reduce Fonksiyonu # 1 - Python Dersleri (Tutorials)" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 89,477,662 |
net_rshares | 0 |
You got a 50.00% upvote from @whalecreator courtesy of @elektroyazilim! Delegate your Steem Power to earn 100% payouts.
author | whalecreator |
---|---|
permlink | re-elektroyazilim-reduce-fonksiyonu-1-python-dersleri-tutorials-20190813t121801015z |
category | palnet |
json_metadata | {"app":"postpromoter/1.9.3"} |
created | 2019-08-13 12:18:00 |
last_update | 2019-08-13 12:18:00 |
depth | 1 |
children | 0 |
last_payout | 2019-08-20 12:18:00 |
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 | 120 |
author_reputation | -582,393,550,059 |
root_title | "reduce Fonksiyonu # 1 - Python Dersleri (Tutorials)" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 89,475,912 |
net_rshares | 0 |
You got a 50.00% upvote from @whalepromobot courtesy of @elektroyazilim!
author | whalepromobot |
---|---|
permlink | re-elektroyazilim-reduce-fonksiyonu-1-python-dersleri-tutorials-20190813t124543072z |
category | palnet |
json_metadata | {"app":"postpromoter/2.0.0"} |
created | 2019-08-13 12:45:42 |
last_update | 2019-08-13 12:45:42 |
depth | 1 |
children | 0 |
last_payout | 2019-08-20 12:45:42 |
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 | 73 |
author_reputation | -231,775,391,844 |
root_title | "reduce Fonksiyonu # 1 - Python Dersleri (Tutorials)" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 89,476,770 |
net_rshares | 0 |