In Python, you may want to assign to some variable outside of the current function instead of creating a new variable in the current one, but you can’t.
In Python, you can use nonlocal to create certain variables in the enclosing scope or global to create a variable in the current module's global scope.
Why do I keep making issues just to be proven that I shouldn't within the next few paragraphs? Maybe I just want to be part of a big project like this.
At the end of chapter 8, you say:
In Python, you can use
nonlocal
to create certain variables in the enclosing scope orglobal
to create a variable in the current module's global scope.