What is a selection statement in Python?
- In some cases in programming, Our program has to decide whether the following block of codes needs to be executed or not, based on some conditions.
- Such Decision making statements/selection statements decide the direction of the flow of program execution.
- Decision making statements/selection statements available in Python are
- if (Simple If)
- if-else
- else-if ladder
- Nested if
- In python, body statements inside the selection statement are indicated by the indentation. The very first unindented line marks the end of the selection statements.