Page 102 - TP_V5.1_C7_fb
P. 102
CONTROL STRUCTURE
A control structure is a programming construct that affects the flow of the execution of a program.
Various types of control structures provided by Python are shown below:
Control Structure
Sequential Statements Selection Statements Iterative Statements
SEQUENTIAL STATEMENTS
The statements that are executed in sequential order, i.e., one after the other without any jumps,
are called sequential statements. A sequential structure is also known as a straight line path.
Statement 1
Statement 2
Statement 3
SELECTION STATEMENTS
Some problems cannot be solved by performing a set of ordered steps as seen in sequential
execution. When programmers are required to execute a particular set of statements depending
on a particular test condition, a selection or decision making statement is required. Python
provides the following selection statements:
(i) if statement (ii) if-else statement (iii) if-elif-else statement
Start
THE if STATEMENT
The if statement is a decision-making statement that is used
False
to control the flow of execution of statements. It contains a if condition
conditional expression, which is used to compare data. A
decision is made based on the result of the comparison. If the True
result of the expression is true, the statements within the if Statements in if block
block are executed and if the result of the expression is false, execute
the statements within the if block are not executed.
Stop
100 Premium Edition-VII

