Use Python If Statements

In this page you learn the if statement in python is same as other languages like c programming language. It is used contains a logical expression test a condition. And decision based on the result of the comparison.

Syntax

if expression:
   statement(s)
	
if-statement

Example of if statement

a=20  
if a==20:  
        print  "Hello World cup T20"

Output

Hello World cup T20