Skip to content

Instantly share code, notes, and snippets.

@drj11
Created November 3, 2016 13:50
Show Gist options
  • Save drj11/94643ca454ffba74441a760f8d70fafe to your computer and use it in GitHub Desktop.
Save drj11/94643ca454ffba74441a760f8d70fafe to your computer and use it in GitHub Desktop.
A closure example
def p():
v = [0]
def x():
print(v)
x()
v = [7]
x()
p()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment