FLOW OF
EXECUTION
IF CONDITIONS
2
Flow of execution
• SEQUENTIAL STATEMENTS
• SELECTION/CONDITION
STATEMENTS
• ITERATION/LOOPING CONSTRUCTS
SEQUENTIAL STATEMENTS
Sequential, as the name suggests, signifies that
statement in a python program are executed one
after the other ,i.e., from the first statement till the
last statement
3
4
EXAMPLE OF SEQUENTIAL STATEMENTS
2.SELECTION/CONDITIONAL
{IF}-STATEMENTS
Conditional statements are used to
perform actions or calculation based
on whether a condition is evaluated as
true or false.
In programming, decision-making or
selection can be achieved through the
conditional statement.
The simplest form is the if statement.
If statement increases the utility of a
program.
5
6
EXAMPLE OF {IF} CONDITIONAL STATEMENTS
2.SELECTION/CONDITIONAL
{IF-ELSE} STATEMENTS
The second type of conditional IF
statement, called if…else, provides an
alternative execution.
If…else allows for two possibilities and
the condition determines which branch
gets executed.
If the condition is true, the statement(s)
followed by if is executed, if the
condition is false, the statement(s)
followed by else will be executed.
7
8
EXAMPLE OF {IF…ELSE} CONDITIONAL STATEMENTS
2.SELECTION/CONDITIONAL
{IF-ELIF-ELSE} STATEMENTS
The flow of program is based
on a single condition and the
statements following the
respective block for ‘if’ and
‘else’ are executed
accordingly.
In case there are multiple
conditions to be handled, then
there is multiple if-elif-else
statements
9
10
EXAMPLE OF {IF…ELIF...ELSE} CONDITIONAL
STATEMENTS
SELECTION/CONDITIONAL
{NESTED IF-ELSE}
STATEMENTS
The nested if..else
statement allows us to
check for multiple test
expressions and execute
different codes for more
than two conditions. And
this is the many level for
nesting inside if…else
statements.
11
12
EXAMPLE OF {NESTED IF..ELSE} CONDITIONAL
STATEMENTS
THANKYOU

Flow of execution.pptx