Skip to content

Instantly share code, notes, and snippets.

@JackInTaiwan
Created November 21, 2018 05:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JackInTaiwan/c76bbb3e8f0be6fddfc273efebc131ea to your computer and use it in GitHub Desktop.
Save JackInTaiwan/c76bbb3e8f0be6fddfc273efebc131ea to your computer and use it in GitHub Desktop.
def dog():
height = 40
def grow_up():
height = height + 1
return grow_up
if __name__ == "__main__":
dog_grow_up = dog()
dog_grow_up()
# > UnboundLocalError: local variable 'height' referenced before assignment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment