As Guido’s linked article says, you should just write an explicit for loop if you want to avoid reduce(). You can replace the line
result = reduce(function, iterable, start)
by
result = start
for x in iterable:
result = function(result, x)
As Guido’s linked article says, you should just write an explicit for loop if you want to avoid reduce(). You can replace the line
result = reduce(function, iterable, start)
by
result = start
for x in iterable:
result = function(result, x)