CBSE Class 12 Computer Science
Question 5 of 103
Working with Functions — Question 5
Back to all questions 5
Question (a)
Both Assertion and Reason are true and Reason is the correct explanation of Assertion.
Explanation
In Python, if a variable is not declared inside a function but is declared at a higher scope level (e.g., in the global scope or an enclosing scope), the function can still access and use that variable. Since Python follows the LEGB rule, variables declared at higher scope levels can be accessed within functions.