Fibonacci series recursion error

harrismh777 harrismh777 at charter.net
Sat Apr 30 07:31:51 CEST 2011


def fib(i=1):
     a=1;n=1;l=[]
     for j in range(0,i):
         l.append(a)
         p=a;a=n;n=p+a
     return l

list=fib(7)



... and the above, is how I would actually code it....




kind regards,
m harris



More information about the Python-list mailing list