Variable declaration and scoping

As we have seen, no type declarations are necessary in Python, and variables are essentially just untyped name bindings to objects. As such, they can be rebound – or reassigned – as often as necessary, even to object of different types.

But when we bind a name to an object, where is that binding stored? To answer that question, we must look at scopes and scoping rules in Python.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset