Conditionals statements help us to execute a block of code based on the result of a condition (usually a boolean expression). These conditional statements select a branch of statements for the execution flow.
- If StatementIf statement can allow to execute a block of statements based on given condition.
- If Else StatementIf Else statement can execute either if-block or else-block statements, based on the result of given condition.
- Elif StatementLadder of “if else-if else” statements with a condition at if block, and each elif block.
- If Statement with “and” OperatorUsing logical AND Operator in IF statement’s condition.
- If Statement with “or” OperatorUsing logical OR Operator in IF statement’s condition.
- If Statement with “not” OperatorUsing logical NOT Operator in IF statement’s condition.
- Ternary OperatorPython Tutorial on the syntax and usage of Ternary Operator. This operator is used to select one of the two values based on a condition.