banner
大数据平台>大数据技术与应用>Python教程pass语句

Python基础教程14:pass 语句

作者: afenxi来源: afenxi时间:2017-02-24 11:13:45

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

passass 不做任何事情,一般用做占位语句。

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

pass

实例:

#!/usr/bin/python # -*- coding: UTF-8 -*- # 输出 Python 的每个字母 for letter in Python: if letter == h: pass print 这是 pass 块 print 当前字母 :, letter print "Good bye!"

以上实例执行结果:

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

原创文章,作者:大西,如若转载,请注明出处:《Python基础教程14:pass 语句》http://www.afenxi.com/post/5156

banner
看过还想看
可能还想看
最新文章
Yonghong Z-Suite一站式大数据分析平台 —— 以卓越的数据技术为客户创造价值,实现客户成功。