Cheap VPS & Xen Server


Residential Proxy Network - Hourly & Monthly Packages

Python Pass


When you do not want any code to execute, pass Statement is used. It is same as the name refers to. It just makes the control to pass by without executing any code. If we want to bypass any code pass statement can be used.

Syntax:

  1. pass

eg:

  1. for i in [1,2,3,4,5]:
  2.     if i==3:
  3.         pass
  4.         print “Pass when value is”,i
  5.     print i,

Output:

  1. >>>
  2. 1 2 Pass when value is 3
  3. 3 4 5
  4. >>>

Comments

comments