so, I saw someone using the reduce method to do recursion. here is his idea (1,0) , (1,1) , (2,1) , (3,2) , (5,3) which is corresponding 1,1,2,3,5,8,13,21 .......
and the code looks like this
def fib_reduce(n): initial =(1,0) dummy = range(n) fib_n = reduce(lambda prev ,b : (prev + prev, prev), dummy, initial) return fib_n
I understand the (perve + perve , perv) which is like a ,b = b , b+a however, I don't understand what is this 'b' stands for ?
May someone please explains this 'b'?