Created
March 21, 2013 10:13
-
-
Save Y4suyuki/5211998 to your computer and use it in GitHub Desktop.
accumulator in Python
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def f(x, y): | |
return x + y | |
def foo(f): | |
def nf(x, *args): | |
return x if not args else f(x, nf(*args)) | |
return nf | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment