Chapter 3 Class Notes
Chapter 3 Class Notes
NOIDA EXTENSION
CLASS 12
COMPUTER SCIENCE
CHAPTER 3. FUNCTIONS
• Scope of variable means the part of program where the variable will be
visible. It means where we can use this variable.
• We can say that scope is the collection of variables and their values.
• Scope can be of two types:
▪ Global (Module): All those names which are assigned at top
level in module or directly assigned in interpreter.
▪ Local (Function): Those variables which are assigned within
a loop of function.
Flow of execution at the time of function call:
• The execution of any program starts from the very first line and this
execution goes line by line.
• One statement is executed at a time.
• Function doesn’t change the flow of any program.
• Statements of function doesn’t start executing until it is called.
• When function is called then the control is jumped into the body of
function.
• Then all the statements of the function get executed from top to bottom
one by one.
• And again, the control returns to the place where it was called.
• And in this sequence the python program gets executed.