Created
April 26, 2015 11:12
-
-
Save suminb/67d6b25de28dc557af33 to your computer and use it in GitHub Desktop.
Test of currying in Python (written in Oct 12, 2010; found from a backup archive on Apr 26, 2015)
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(n): | |
def g(m): | |
def h(s): | |
return m + n + s | |
return h | |
return g | |
a = f(1)(2) | |
print a | |
print a(3) | |
b = f(1) | |
print b(10)(20) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment