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:

if condition: 

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 num==1: 

If statment flow chart

Python if Statement