Skip to content

Instantly share code, notes, and snippets.

@bergerx
Created July 25, 2012 13:53
Show Gist options
  • Save bergerx/3176300 to your computer and use it in GitHub Desktop.
Save bergerx/3176300 to your computer and use it in GitHub Desktop.
reply to gist: 3176161
def create_counter():
scope={'i':0}
def increment():
scope['i'] +=1
print scope['i']
return increment
count = create_counter()
count()
count()
count()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment