Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
mustafamuratcoskun
GitHub Repository: mustafamuratcoskun/Sifirdan-Ileri-Seviyeye-Python-Programlama
Path: blob/master/Pythondaki Gömülü Fonksiyonlar/Videolardaki Notebooklar/Reduce Fonksiyonu.ipynb
765 views
Kernel: Python 3
from functools import reduce
def toplama(x,y): return x + y
reduce(toplama,[12,18,20,10])
60
reduce(lambda x,y : x * y,[1,2,3,4,5])
120
def maksimum(x,y): if (x > y): return x else: return y
maksimum(3,4)
4
reduce(maksimum,[-2,3,1,4])
4