Created
March 7, 2014 04:22
-
-
Save inducer/9405205 to your computer and use it in GitHub Desktop.
Closures demo
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 fake_newton(f): | |
print f(17) | |
def main(): | |
target_value = 18 | |
def f(x): | |
return x - target_value | |
fake_newton(f) | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment