scope

The region of a program where a name can be seen and used.

In more detail

Python looks a name up in the local scope of the current function, then any enclosing functions, then the module's global scope, and finally the built-ins. Assignment inside a function makes a local name unless declared global.

Related terms

Taught in

References

Certification courses