I am trying to wrap my head around the following code. Am I right to deduce that a is mapped to (a+x) and x is an iterator that subsequently iterates over each element in the collection? (e.g. initially is zero, then 1, then 2)?
Any pointers much appreciated!
sum = reduce(lambda a, x: a + x, [0, 1, 2, 3, 4])
print sum #10