How does python resolve the scope of a name or identifier?
Answers
Answered by
14
Scope resolution for a given name begins from the inner-most function and then goes higher and higher until the program finds the related object. If the search ends without any outcome, then the program throws a NameError exception.
Similar questions