Python, the scope of a variable is always determined by the place in the code of the assigned.
When Python encounters a variable, then he will be searched in this order:
Local scope (Local) → current scope embedded local scope (Enclosing locals) → global / module scope (Global) → built scope (Built-in)