Fibonacci2

Print the first n Fibonacci numbers
import sys def fib(n,x=[0,1]): for i in range(abs(n)-1): x=[x[1],sum(x)] return x[1]*pow(-1,abs(n)-1) if n<0 else x[1] if n else 0 for i in range(1,int(sys.argv[1])): print fib(i)
 * 1) !/usr/bin/python

fibseq=[1,1,] fiblen=40 for x in range(1,fiblen-1): xcount=fibseq[x-1]+fibseq[x] fibseq.append(xcount) print(xcount)