-
Notifications
You must be signed in to change notification settings - Fork 711
Open
Description
Reduce would read more clearly if the variables in the example explained themselves. After making use of the reduce method outlined in your docs, I ended up further researching the method on additional sites to understand that the variable x is an accumulator. Consider replacing your example with the following, and/or applying the same idea to other examples in your docs. Something like acc and el would also suffice. Thanks for the resource.
from functools import reduce
product = reduce((lambda accumulator, element: accumulator * element), [1, 2, 3, 4])
Metadata
Metadata
Assignees
Labels
No labels