Skip to content

Instantly share code, notes, and snippets.

@AnnikaNoren
Created October 20, 2020 17:42
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 AnnikaNoren/a58fbdebb5bd099ab8ef32b819daa549 to your computer and use it in GitHub Desktop.
Save AnnikaNoren/a58fbdebb5bd099ab8ef32b819daa549 to your computer and use it in GitHub Desktop.
def outer_func():
x = "local"
def inner_func():
nonlocal x
x = "nonlocal"
print("inner:", x)
inner_func()
print("outer:", x)
outer_func()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment