Advertisements
Advertisements
Question
Which scope refers to variables defined in current function?
Options
Local Scope
Global scope
Module scope
Function Scope
Solution
Local Scope
APPEARS IN
RELATED QUESTIONS
Which of the following refers to the visibility of variables in one part of a program to another part of the same program.
What is a scope?
Why scope should be used for variable. State the reason.
Identify the scope of the variables in the following pseudo-code and write its output
color:= Red
mycolor():
b:=Blue
myfavcolor():
g:=Green
printcolor, b, g
myfavcolor()
printcolor, b
mycolor()
print color
What is meant by the scope of a variable? Mention its types.
Define global scope.
Write the rules of a local variable.
Write the basic rules for a global keyword in python.
What happens when we modify the global variable inside the function?
Explain the scope of variables with an example.