Python pass 语句
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!
(编辑:雷林鹏 来源:网络)
原文地址:https://www.cnblogs.com/pengpeng1208/p/9856249.html
时间: 2024-11-14 15:43:29