Python namespaces are containers that hold mappings of names to objects. There are four types of namespaces in Python: Built-in, Global, Enclosing, and Local. Each namespace has a specific scope and ...
Python program follows LEGB rule when trying to access a variable. (a) L(Local): Variables defined within a function or block have local scope. They're only accessible within that function or block.