KnowledgeBoat Logo

Computer Science

Define flow of execution. What does it do with functions?

Python Functions

3 Likes

Answer

Flow of execution refers to the order in which statements are executed during a program run.

Execution always begins at the first statement of the program. Statements are executed one at a time, starting from the top to the bottom. Function definition does not alter the flow of execution of a program, as the statement inside the function is not executed until the function is called. On a function call, instead of going to the next statement of the program, the control jumps to the body of the function, executes all statements of the function, starting from the top to the bottom and then comes back to the point where it left off.

Answered By

3 Likes


Related Questions