2 ms·
Recursive factorial computed entirely with anonymous functions in Python: >>> (lambda n: (lambda f, n: f(f, n))( ... lambda f, n: n*f(f, n-1) if n > 0 else
by d0mine 18y ago
Recursive factorial computed entirely with anonymous functions in Python:
>>> (lambda n: (lambda f, n: f(f, n))(
... lambda f, n: n*f(f, n-1) if n > 0 else 1,n)
... )(10)
3628800
http://stackoverflow.com/questions/481692/can-a-lambda-function-call-itself-recursively-in-python http://stackoverflow.com/questions/481692/can-a-lambda-funct...