Composition
Explore the concept of function composition, where one function operates on another's result. Understand how to handle multi-argument functions using partial application and currying to create cleaner, more modular Python code.
We'll cover the following...
We'll cover the following...
What is composition?
It is quite common in programming to have one function operate on the result of another function.
For example, to calculate the square of the sine of x we use square(math.sin(x)). To create an iterator that counts down from n-1 to 0, we use reversed(range(n)).
We refer ...