Python if Statement is used for decision-making operations. It contains a body of code that runs only when the condition given in the if statement is true. If the condition is false, then the optional else statement runs, which contains some code for the else condition.
When you want to justify one condition while the other condition is not true, then you use Python if-else statement.
Python if Statement Syntax:
if expression
Statement
else
Statement
Python if…else Flowchart
