The pass statement is like 0 in mathematics,
does not have any practical meaning, but it is a character that does exist. So, Python
Pass Statementis an empty statement, in order to maintain the integrity of the program structure,
PassDon't do anything, general
Used as a placeholder statement,
The effect is the same as break, the meaning is completely opposite.
The Python language Pass statement has the following syntax format:
Pass
Instance:
#!/usr/bin/python#-*-coding:utf-8-*-# Output Python for letters in ' Python ': "if letter = = ' h ': pass Print ' This is the pass block ' print ' current letters: ', letter print ' good bye! '
The result of the above instance execution:
Current Letter: P
Current Letter: Y
Current Letter: T
This is a pass block.
Current Letter: H
Current Letter: O
Current Letter: N
Good bye!
These are the control statements for the Python Loop statement article:
The usage and function of the continue statement of the Python statement
Break statement in Python statement jumps out of Loop instance