Skip to content

Instantly share code, notes, and snippets.

@thisfred
Last active August 29, 2015 14:16
Show Gist options
  • Save thisfred/8a147368b437a39e105c to your computer and use it in GitHub Desktop.
Save thisfred/8a147368b437a39e105c to your computer and use it in GitHub Desktop.
def foo():
closed = {'a': 1}
def increase():
closed['a'] += 1
print(closed['a'])
return increase
my_counter = foo()
my_counter()
my_counter()
my_counter()
my_counter()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment