Iteration for Factorials

Boris Borcic bborcic at gmail.com
Tue Oct 30 08:09:38 EDT 2007


Py-Fun wrote:
> I'm stuck trying to write a function that generates a factorial of a
> number using iteration and not recursion.  Any simple ideas would be
> appreciated.
> 

fact = lambda n : len(map([1].__imul__,range(1,n+1))[0])

hth :)

BB



More information about the Python-list mailing list