-
-
Save dlisboa/829f3b04922d06367835 to your computer and use it in GitHub Desktop.
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 make_adder(): | |
grand_total = 0 | |
def adder(to_add): | |
print "Grand total moved from: %s" % grand_total | |
grand_total += to_add | |
print "To: %s \n" % grand_total | |
return grand_total | |
return adder | |
adder = make_adder() | |
adder(1) | |
adder(2) | |
adder(3) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment