Any expression which returns either true or false that expression is known as condition.
Python Conditional Statements :
The Python Conditional statements are used to decide whether the code has to be execute or skip based on evaluation of the expression.
Elements of Conditional Statements :
While working with conditional statements we use two elements :
- Condition
- Block
Condition : Any expression which returns either true or false that expression is known as Condition.
Block : All the statements which are falling under the same space indentation is known as Block.
- Blocks begins with when the indentation increases.
- Blocks can contain multiple blocks.
- Blocks ends when indentation decreases to zero or to a containing blocks indentation.
Typically Python supports three conditional statements, there are :
- if (or) simple if
- if else
- elif
Happy Learning 🙂