Python if Statement

This statement is used to execute one or more statement depending on whether a condition is True or not.

The syntax or correct format of if statement is given below:

First, the condition is tested. If the condition is True, then the statements given after colon (:) are executed. We can write one or more statements after colon (:).

If the condition is False, then the statements mentioned after colon are not executed.

If statment flow chart

If Statement Flow