Python pass Statement

Python pass is a null statement, intended to maintain the integrity of the program structure.

passIt does nothing and is generally used as a placeholder statement.

The syntax format of the pass statement in the Python language is as follows:

pass

Test example:

Example

#!/usr/bin/python # -*- coding: UTF-8 -*- # Output each letter of Python for letter in 'Python': if letter == 'h': pass print 'This is a pass block' print 'Current letter:', letter print "Good bye!"

The execution result of the above example is:

当前字母 : P
当前字母 : y
当前字母 : t
这是 pass 块
当前字母 : h
当前字母 : o
当前字母 : n
Good bye!
Other Extensions