第一章开胃菜Whetting Your Appetite 1 第二章使用Python解释器Using the Python Interpreter 3 2.1 调用解释器Invoking the Interpreter 2.2 解释器及其环境The Interpreter and Its Environment 第三章Python的非正式介绍An Informal Introduction to Python 9 3.1 初步认识Python Using Python as a Calcula
前言 Front Matter Contents 1. 开胃菜 Whetting Your Appetite 2. 使用Python解释器 Using the Python Interpreter 2.1 调用解释器 Invoking the Interpreter 2.1.1 参数传递 Argument Passing 2.1.2 交互模式 Interactive Mode 2.2 解释器及其环境 The Interpreter and Its Environment 2.2.1 错误处理
本书全面系统地介绍了Red Hat Linux 6。全书共分为五个部分,包括35章和四个附录。第一部分为Red Hat Linux的介绍和安装;第二部分为服务配置;第三部分为系统管理;第四部分为Linux编程;第五部分为附录。本书内容翔实、涉及领域广泛,并且提供了详细的例子和大量的参考资料(包括书籍、电子文档和Internet站点),是一本学习、使用和管理Linux不可多得的好书。 目 录 译者序 前言 第一部分 Red Hat Linux的介绍与安装 第1章 Red Hat Linux和UN
前言 Front Matter Contents 1. 开胃菜 Whetting Your Appetite 2. 使用Python解释器 Using the Python Interpreter 2.1 调用解释器 Invoking the Interpreter 2.1.1 参数传递 Argument Passing 2.1.2 交互模式 Interactive Mode 2.2 解释器及其环境 The Interpreter and Its Environment 2.2.1 错误处理
在Python中的while或者for循环之后还可以有else子句,作用是for循环中if条件一直不满足,则最后就执行else语句。
for i in range(5):
if i == 1:
print 'in for'
else:
print 'in else'
print 'after for-loop'
# in for
# in else
# after for-loop
但我们发现if条件在循环的过程中成立了,最终还是执行了else语句里的内容,这是为什么呢?
好的,我们