Direction: Choose the correct option
Q1.
What is the scope of a variable defined inside a function?
Direction: Choose the correct option
Q2.
How do you modify a global variable inside a function?
Direction: Choose the correct option
Q3.
What is the output of `x=5; def f(): x=10; print(x); f(); print(x)`?
Direction: Choose the correct option
Q4.
What does `nonlocal` do?
Direction: Choose the correct option
Q5.
Given nested function, how do you access an outer function's variable?
Direction: Choose the correct option
Q6.
What will `def f(): print(x); x=10` do?
Direction: Choose the correct option
Q7.
What is the built-in scope?
Direction: Choose the correct option
Q8.
How can you see all global variables?
Direction: Choose the correct option
Q9.
What is the LEGB rule?
Direction: Choose the correct option
Q10.
If a variable is defined inside a function, can it be accessed outside?
