There are two ways to control the program flow as given below:-
3
- Decision control instruction (e.g. if ,if-else,elif)
- Repetition control instruction (e.g. while,for)
Indentation in Python:-
- Indentation is used to declare a block in python.If two statements are at the same indentation level,then they are the part of the same block.
- Python doesn't allow the use of parentheses for the block of codes.
- All the statements of one block are intended at the same level indentation.
- In this,we will see how the actual indentation takes place in decision control instructions and others in python.
Decision control instruction:-
There are three ways for taking decisions in a program as given below.
- if condition
- if-else condition
- elif condition