reduce explains: reduce acts a function on a sequence [x1, x2, x3,.] This function must take two arguments. Reduce accumulates the result and the next element of the sequence.
Code:
>>> from functools import reduce
>>> def add(x, y):
... return x + y
...
>>> reduce(add, [1, 2,3])-sharp6
>>> reduce(add, [1])-sharp1
question: two parameters are required, parameter x and parameter y are what, reduce (add, [1]). In this case, I don"t understand how this reduce works