Mozne to je, ale nevim, zda tohle zrovna v Pythonu chces delat
https://stackoverflow.com/questions/481692/can-a-lambda-function-call-itself-recursively-in-python
je to dost nepekne
Python 2.7.6 (default, Nov 23 2017, 15:49:48)
[GCC 4.8.4] on linux2
Type "copyright", "credits" or "license()" for more information.
>>> map(lambda n: (lambda f, *a: f(f, *a))(lambda rec, n: 1 if n == 0 else n*rec(rec, n-1), n), [1, 2, 3, 4, 5])
[1, 2, 6, 24, 120]
>>>
[code python 3.4]
Python 3.4.3 (default, Nov 28 2017, 16:41:13)
[GCC 4.8.4] on linux
Type "copyright", "credits" or "license()" for more information.
>>> map(lambda n: (lambda f, *a: f(f, *a))(lambda rec, n: 1 if n == 0 else n*rec(rec, n-1), n), [1, 2, 3, 4, 5])
<map object at 0x7f3c31f384a8>
>>> list(map(lambda n: (lambda f, *a: f(f, *a))(lambda rec, n: 1 if n == 0 else n*rec(rec, n-1), n), [1, 2, 3, 4, 5]))
[1, 2, 6, 24, 120]
>>>
[/code]