Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
4
Task/Anonymous-recursion/Python/anonymous-recursion-5.py
Normal file
4
Task/Anonymous-recursion/Python/anonymous-recursion-5.py
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
>>> Y = lambda f: lambda n: f(f,n)
|
||||
>>> fib = lambda f, n: None if n < 0 else (0 if n == 0 else (1 if n == 1 else f(f,n-1) + f(f,n-2))) #same as the first three implementations
|
||||
>>> [ Y(fib)(i) for i in range(-2, 10) ]
|
||||
[None, None, 0, 1, 1, 2, 3, 5, 8, 13, 21, 34]
|
||||
Loading…
Add table
Add a link
Reference in a new issue