pythonpass语句

python pass是空语句,是为了保持程序结构的完整性。

python 语言 pass 语句语法格式如下:

pass

实例:

#!/usr/bin/python
for letter in ‘python’:
if letter == ‘h’:
pass
print ‘this is pass block’
print ‘current letter :’, letter
print “good bye!”

以上实例执行结果:

current letter : p

current letter : y

current letter : t

this is pass block

current letter : h

current letter : o

current letter : n

good bye!

Posted in 未分类

发表评论