As long as the expression given by these control statements is not true, then it is its own statement; does not execute
If the expression in true if statement is true then it executes its statement and if the expression is false then else statement; execute.
How Can I use if else Statement in Python?, if else Statement Use in Python
Syntax of if else Statement
if expression : if_statement(s) else : else_statement(s)
Syntax of if else Statement Source Code :
a = 2 b = 2 if(a < b) : print("a is less than b") else : print("a is greater than or equal to b")
Output :
a is greater than or equal to b