Cheap VPS & Xen Server


Residential Proxy Network - Hourly & Monthly Packages

Python If


The if statement in python is same as c language which is used test a condition. If condition is true, statement of if block is executed otherwise it is skipped.

Syntax of python if statement:

  1. if(condition):
  2.    statements

Example of if statement in python

  1. a=10
  2. if a==10:
  3.         print  “Hello User”

Output:

Hello User

Comments

comments