Chris Angelico wrote:
Commenting is like dieting. You can always start tomorrow.

I've been meaning to become a procrastinator, but
I think I'll start tomorrow.

In the meantime, since we seem to be having a
fibbing competition, here's my contribution, that
uses neither recursion nor (explicit) iteration:

from numpy import array, dot

a = array([[0,1],[1,1]])
b = array([0,1])

def fib(n):
   return reduce(dot,[a]*n+[b])[1]

for i in range(10):
   print(fib(i))

--
Greg
--
https://mail.python.org/mailman/listinfo/python-list

Reply via email to