Level 014
Level 014
python3
"Working in The Scope of Global Scope(Program Level)"
import os
os.system("cls")
print("\n----------------GLOBAL SCOPE BEGINS HERE-----------------", end = "\n")
def outerFunction() :
"Working in The Scope of Outer Function(Enclosed Scope)"
print("\n----------------ENCLOSE SCOPE BEGINS HERE-----------------", end =
"\n")
print("\nAssigning The Variable in Enclosed Scope(outerFunction)", end = "\
n")
outerVariable = 10
def innerFunction() :
"Working in The Scope of Inner Function(Local Scope)"
print("\n----------------LOCAL SCOPE BEGINS HERE-----------------", end
= "\n")
print("\nAccessing The Variable in Local Scope(innerFunction) Belonging
To Enclosed Scope(outerFunction)", end = "\n")
print("\nThe Outer Function Variable Value is : ", outerVariable, end =
"\n")
print("\n----------------LOCAL SCOPE ENDS HERE-----------------", end =
"\n")
def outerFunction() :
"Working in The Scope of Outer Function(Enclosed Scope)"
print("\n----------------ENCLOSE SCOPE BEGINS HERE-----------------", end =
"\n")
print("\nAssigning The Variable in Enclosed Scope(outerFunction)", end = "\
n")
outerVariable = 10
def innerFunction() :
"Working in The Scope of Inner Function(Local Scope)"
print("\n----------------LOCAL SCOPE BEGINS HERE-----------------", end
= "\n")
print("\nAccessing The Variable in Local Scope(innerFunction) Belonging
To Enclosed Scope(outerFunction)", end = "\n")
print("\nThe Outer Function Variable Value is : ", outerVariable, end =
"\n")
print("\n----------------LOCAL SCOPE ENDS HERE-----------------", end =
"\n")
def outerFunction() :
"Working in The Scope of Outer Function(Enclosed Scope)"
print("\n----------------ENCLOSE SCOPE BEGINS HERE-----------------", end =
"\n")
print("\nAssigning The Variable in Enclosed Scope(outerFunction)", end = "\
n")
outerVariable = 10
print("\n----------------ENCLOSE SCOPE ENDS HERE-----------------", end = "\
n")
def outerFunction() :
"Working in The Scope of Outer Function(Enclosed Scope)"
print("\n----------------ENCLOSE SCOPE BEGINS HERE-----------------", end =
"\n")
print("\nAssigning The Variable in Enclosed Scope(outerFunction)", end = "\
n")
outerVariable = 10
print("\n----------------ENCLOSE SCOPE ENDS HERE-----------------", end = "\
n")
print("\nAssigning The Reference Address of The outerFunction() To Another
Variable", end = "\n")
refOuterFunction = outerFunction
print("\nPrinting The Reference Address of The outerFunction()'s Reference Variable
From Global Scope(Program Level)", end = "\n")
print("\nThe Reference Address of The Outer Function From Reference Variable is :
", refOuterFunction, end = "\n")
print("\nPrinting The Reference Address of The outerFunction() From Global
Scope(Program Level)", end = "\n")
print("\nThe Reference Address of The Outer Function is : ", outerFunction, end =
"\n")
print("\nouterFunction() Has Returned Back To Global Scope(Program Level)", end =
"\n")
print("\n----------------GLOBAL SCOPE ENDS HERE-----------------", end = "\n")#!
python3
"Working in The Scope of Global Scope(Program Level)"
import os
os.system("cls")
print("\n----------------GLOBAL SCOPE BEGINS HERE-----------------", end = "\n")
def outerFunction() :
"Working in The Scope of Outer Function(Enclosed Scope)"
print("\n----------------ENCLOSE SCOPE BEGINS HERE-----------------", end =
"\n")
print("\nAssigning The Variable in Enclosed Scope(outerFunction)", end = "\
n")
outerVariable = 10
def innerFunction() :
"Working in The Scope of Inner Function(Local Scope)"
print("\n----------------LOCAL SCOPE BEGINS HERE-----------------", end
= "\n")
print("\nAccessing The Variable in Local Scope(innerFunction) Belonging
To Enclosed Scope(outerFunction)", end = "\n")
print("\nThe Outer Function Variable Value is : ", outerVariable, end =
"\n")
print("\nReturning The innerFunction() Through Return Statement at
Local Scope(innerFunction)", end = "\n")
print("\n----------------LOCAL SCOPE ENDS HERE-----------------", end =
"\n")
return innerFunction()
def outerFunction() :
"Working in The Scope of Outer Function(Enclosed Scope)"
print("\n----------------ENCLOSE SCOPE BEGINS HERE-----------------", end =
"\n")
print("\nAssigning The Variable in Enclosed Scope(outerFunction)", end = "\
n")
outerVariable = 10
def innerFunction() :
"Working in The Scope of Inner Function(Local Scope)"
print("\n----------------LOCAL SCOPE BEGINS HERE-----------------", end
= "\n")
print("\nAssigning The Variable in Local Scope(innerFunction)", end =
"\n")
innerVariable = 20
print("\nAdding The Local Scope Variable With Enclose Scope Variable",
end = "\n")
innerResult = outerVariable + innerVariable
print("\nReturning The innerFunction() Through Return Statement at
Local Scope(innerFunction)", end = "\n")
print("\n----------------LOCAL SCOPE ENDS HERE-----------------", end =
"\n")
print("\n----------------ENCLOSE SCOPE ENDS HERE-----------------", end
= "\n")
return innerResult
def outerFunction() :
"Working in The Scope of Outer Function(Enclosed Scope)"
print("\n----------------ENCLOSE SCOPE BEGINS HERE-----------------", end =
"\n")
print("\nAssigning The Variable in Enclosed Scope(outerFunction)", end = "\
n")
outerVariable = 10
def innerFunction() :
"Working in The Scope of Inner Function(Local Scope)"
print("\n----------------LOCAL SCOPE BEGINS HERE-----------------", end
= "\n")
print("\nAssigning The Variable in Local Scope(innerFunction)", end =
"\n")
innerVariable = 20
print("\nAdding The Local Scope Variable With Enclose Scope Variable",
end = "\n")
innerResult = outerVariable + innerVariable
print("\nReturning The innerFunction() Through Return Statement at
Local Scope(innerFunction)", end = "\n")
print("\n----------------LOCAL SCOPE ENDS HERE-----------------", end =
"\n")
print("\n----------------ENCLOSE SCOPE ENDS HERE-----------------", end
= "\n")
return innerResult
def outerFunction() :
"Working in The Scope of Outer Function(Enclosed Scope)"
print("\n----------------ENCLOSE SCOPE BEGINS HERE-----------------", end =
"\n")
print("\nAssigning The Variable in Enclosed Scope(outerFunction)", end = "\
n")
outerVariable = 10
def innerFunction() :
"Working in The Scope of Inner Function(Local Scope)"
print("\n----------------LOCAL SCOPE BEGINS HERE-----------------", end
= "\n")
print("\nAssigning The Variable in Local Scope(innerFunction)", end =
"\n")
innerVariable = 20
print("\nAdding The Local Scope Variable With Enclose Scope Variable",
end = "\n")
innerResult = outerVariable + innerVariable
print("\nReturning The innerFunction() Through Return Statement at
Local Scope(innerFunction)", end = "\n")
print("\n----------------LOCAL SCOPE ENDS HERE-----------------", end =
"\n")
print("\n----------------ENCLOSE SCOPE ENDS HERE-----------------", end
= "\n")
return innerResult
def outerFunction() :
"Working in The Scope of Outer Function(Enclosed Scope)"
print("\n----------------ENCLOSE SCOPE BEGINS HERE-----------------", end =
"\n")
print("\nAssigning The Variable in Enclosed Scope(outerFunction)", end = "\
n")
outerVariable = 10
def innerFunction() :
"Working in The Scope of Inner Function(Local Scope)"
print("\n----------------LOCAL SCOPE BEGINS HERE-----------------", end
= "\n")
print("\nAssigning The Variable in Local Scope(innerFunction)", end =
"\n")
innerVariable = 20
print("\nAdding The Local Scope Variable With Enclose Scope Variable",
end = "\n")
innerResult = outerVariable + innerVariable
print("\nReturning The innerFunction() Through Return Statement at
Local Scope(innerFunction)", end = "\n")
print("\n----------------LOCAL SCOPE ENDS HERE-----------------", end =
"\n")
print("\n----------------ENCLOSE SCOPE ENDS HERE-----------------", end
= "\n")
return innerResult