Python pass is an empty statement to maintain the integrity of the program structure.
pass does nothing, and is generally used as a placeholder statement.
The syntax format of the pass statement in Python language is as follows:
pass
Test case:
#! /usr/bin/python
# - *- coding: UTF-8-*-
# Output every letter of Python
for letter in'Python':if letter =='h':
pass
print 'This is the pass block'
print 'Current letter:', letter
print "Good bye!"
Execution results of the above examples:
Current letter: P
Current letter: y
Current letter: t
This is the pass block
Current letter: h
Current letter: o
Current letter: n
Good bye!
Recommended Posts