Can python find fibonacci series in a single line of code?

Patrick.Carabin at MyRealBox.COM Patrick.Carabin at MyRealBox.COM
Tue Nov 12 08:31:04 EST 2002


If You change :
print reduce (lambda x,y: (x[1],x[0]+x[1], x[2]+[x[1]]), xrange(10), (0,1,[]))[2]
into :
print reduce (lambda x,y: (x[1],x[0]+x[1], x[2]+[x[1]]), xrange(99), (0,1L,[]))[2]
it should remain working without overflow...



More information about the Python-list mailing list