CBSE Class 12 Computer Science
Question 41 of 103
Working with Functions — Question 17
Back to all questionsL E G B
Reason — When you access a variable from within a program or function, python follows name resolution rule, also known as LEGB rule. When python encounters a name (variable or function), it first searches the local scope (L), then the enclosing scope (E), then the global scope (G), and finally the built-in scope (B).