WEB DEVELOPER SITE
PHP7
 

Python pass Statement


pass statement is a null operation; nothing happens when it executes

Syntax

pass

Example

#!/usr/bin/python

for letter in 'Welookups': 
   if letter == 'u':
      pass
      print 'This is pass block'
   print 'Current Letter :', letter

print "thanks"
When the above code is executed, it produces following result −
$python main.py
Current Letter : W
Current Letter : e
Current Letter : l
Current Letter : o
Current Letter : o
Current Letter : k
This is pass block
Current Letter : u
Current Letter : p
Current Letter : s
thanks