What is Scope of Python

Explain what is the Scope of Python?

E

Expert

Verified

A scope refers to a textual region of the Python program in which a name space is directly accessible. Directly accessible, here means that the unqualified reference to the name attempts in order to find the name within the name space.

Though scopes are estimated statically, they are generally used dynamically. At any time during the execution, exactly three nested scopes are in use that means exactly three name spaces are directly accessible: innermost scope, that is searched first, consists of the local names, searched next, the middle scope, comprises of the current module’s global names, and outermost scope (searched last) refers to the name space which is consisting of the built-in names.

   Related Questions in Computer Networking

©TutorsGlobe All rights reserved 2022-2023.