What is reduce function in python? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

What is reduce function in python?

9th Oct 2021, 9:34 AM
Vinay Jaiswal
Vinay Jaiswal - avatar
3 Answers
+ 3
The real resource you should be looking for is https://docs.python.org/3/library/functools.html#functools.reduce This is pythons manual. It will tell you every function as well an explanation, source code and implementation. Its important to read the actual manual as it will tell you the actual theory behind the functions purpose. Would you rather look at an online manual for your car or the actual manual made for your car? These are things we have to consider when trying to learn programming.
9th Oct 2021, 9:47 AM
Jibraeel Abdelwahhab
Jibraeel Abdelwahhab - avatar
0
Python's reduce() is a function that implements a mathematical technique called folding or reduction. reduce() is useful when you need to apply a function to an iterable and reduce it to a single cumulative value.
9th Oct 2021, 11:20 AM
Sunday Yemi Olanisimi 🇳🇬
Sunday Yemi Olanisimi 🇳🇬 - avatar