I am trying to implement a fibonacci function that should takes as input 3 arguments, r = the number of the output elements, 'a' the start number and 'b' the second number. fib(r,a,b)
I have done the following but something goes wrong:
def fib(r,a,b):
return [[(a,b),fib(i,b,a+b)] for i in range(r)]
Can anyone said me where is the problem and help me to solve it?
range(SOME_BIG_NUMBER)will actually create a list with many numbers inside before doing anything.