There are three types of Control Statements in Python.
  • if
  • if_else 
  • if_elif_else 

As long as the expression given by these control statements is not true, then it is its own statement; does not execute.

When an expression is true in an if statement then it executes its statement and if the expression is false then it is not executed.

Syntax for if Statement

if expression:
  if_statement (s)


Example:-

if Statement

Source Code:

x = 9
y = 10
if statement

if (x <y):
     print ("x is less than y")

Output:

x is less than y

check my previous  post click here