Created
March 30, 2012 02:17
-
-
Save solomon081/2245848 to your computer and use it in GitHub Desktop.
Closure Example
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
#!/usr/bin/env python | |
def multby(factor): | |
def mult(value): | |
return value * factor | |
return mult | |
times2 = multby(2) | |
times2(5) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment