This article mainly introduces the use of the pass statement in Python explanation, is the basic knowledge of Python introductory learning, need friends can refer to the
The Python Pass statement uses when the statement requires that no commands or code be executed.
The pass statement is an empty (null) operation, and there is no response at execution time. Pass is also the code that will eventually be useful, but not written out (for example, in a stub):
The Python Pass statement syntax is as follows:
|1 2 3 4 5 6 7 8 9||#!/usr/bin/python for letter in ' Python ': if letter = = ' h ': Pass print ' here ' pass ' print ': ', le tter print "Good bye!"|
When the above code is executed, it produces the following results:
|current letter:p current Letter:y current Letter:t the This are pass blocks current letter:h current Letter:o Curren T letter:n good bye!|