Java知识分享网 - 轻松学习从此开始!    

Java知识分享网

Java1234官方群25:java1234官方群17
Java1234官方群25:838462530
        
SpringBoot+SpringSecurity+Vue+ElementPlus权限系统实战课程 震撼发布        

最新Java全栈就业实战课程(免费)

springcloud分布式电商秒杀实战课程

IDEA永久激活

66套java实战课程无套路领取

锋哥开始收Java学员啦!

Python学习路线图

锋哥开始收Java学员啦!
当前位置: 主页 > Java文档 > Python技术 >

Python全案例学习与实践 沈红卫 PDF 下载


分享到:
时间:2024-03-13 11:09来源:http://www.java1234.com 作者:转载  侵权举报
"本书是一本覆盖研究生、本专科生、中学生等所有Python学习者的入门书。以""够用、适用、易学”为原则,组织、设计全书的框架和内容,全书共包括四篇:第一篇——营造环境,主要
失效链接处理
Python全案例学习与实践 沈红卫 PDF 下载

下载地址:
版权归出版社和原作者所有,链接已删除,请购买正版

用户下载说明:

电子版仅供预览,下载后24小时内务必删除,支持正版,喜欢的请购买正版书籍:
https://product.dangdang.com/11704921774.html
 

相关截图:




资料简介:

"本书是一本覆盖研究生、本专科生、中学生等所有Python学习者的入门书。以""够用、适用、易学”为原则,组织、设计全书的框架和内容,全书共包括四篇:第一篇——营造环境,主要阐述学习的环境与平台安装、IDLE与Pycharm的使用、常见的内外部模块及其安装。第二篇——掀起头盖,重点讨论Python的主要语法:数据类型、变量常量、语句、输入输出、函数与模块化、文件与对象、类、异常。第三篇——实战演习,主要展示了四个完整的应用案例,涵盖桌面小游戏、数据挖掘与分析、图像识别与机器学习、智能检测与控制。第四篇——继续前进,着重讨论了脚本文件的打包、代码的Pythonic化和Python的博大精深。 本书在内容组织和框架设计上具有两个鲜明特点:全案例、基于读者学习。从读者学习的角度,组织每个章节的内容体系,几乎所有的知识点都辅之以范例,同时给出了四个完整的综合性工程案例,这些都十分有利于学习者学习......


资料目录:


第 1 章 Python 及其安装 ··························································································· (2)
1.1 为什么要学习 Python ···················································································· (2)
1.1.1 Python 的广泛性 ······················································································· (2)
1.1.2 Python 的新颖性 ······················································································· (3)
1.1.3 Python 的生态性 ······················································································· (4)
1.1.4 Python 的应用领域举例 ·············································································· (5)
1.1.5 Python 的局限性 ······················································································· (6)
1.2 学习 Python 的必备“神器” ········································································· (6)
1.2.1 Python 概况 ····························································································· (6)
1.2.2 常用的 Python 集成开发环境 ······································································· (8)
1.3 安装和设置 Python ························································································ (9)
1.3.1 获取 Python ····························································································· (9)
1.3.2 安装 Python ··························································································· (11)
1.3.3 设置 Python ··························································································· (15)
思考与实践 ········································································································· (19)
第 2 章 IDLE 的使用 ································································································ (20)
2.1 IDLE 的安装与设置 ···················································································· (20)
2.1.1 IDLE 的安装 ························································································· (20)
2.1.2 IDLE 的启动 ························································································· (21)
2.1.3 IDLE 的个性化设置 ················································································ (21)
2.2 Edit 编辑模式与 Shell 命令行模式的切换 ····················································· (25)
2.2.1 Edit 编辑模式与 Shell 命令行模式的切换方式 ················································ (25)
2.2.2 IDLE 的文本编辑功能 ············································································· (27)
2.3 在 IDLE 中运行程序 ···················································································· (29)
2.3.1 在 Edit 模式下运行程序 ············································································ (30)
2.3.2 在 Shell 模式下运行程序 ·········································································· (30)
2.4 IDLE 的程序调试功能 ················································································· (31)
2.4.1 两种调试方法 ························································································ (31)
2.4.2 在 Shell 模式下的程序调试 ······································································· (32)
2.4.3 在 Edit 模式下的程序调试 ········································································· (34)
2.4.4 断点调试 ······························································································ (35)

2.5 在 Shell 模式下如何清屏 ············································································· (35)
思考与实践 ········································································································· (37)
第 3 章 安装 PyCharm ····························································································· (38)
3.1 PyCharm 及其安装 ······················································································ (38)
3.1.1 PyCharm 的 3 种版本形式 ········································································· (38)
3.1.2 获取 PyCharm ························································································ (40)
3.1.3 安装 PyCharm ························································································ (42)
3.2 PyCharm 的个性化设置 ··············································································· (45)
3.2.1 设置入口 ······························································································ (45)
3.2.2 外观设置 ······························································································ (47)
3.2.3 Editor 与自动代码补齐设置 ······································································· (47)
3.2.4 解释器设置 ··························································································· (48)
3.2.5 运行键设置 ··························································································· (50)
思考与实践 ········································································································· (52)
第 4 章 Python 的标准资源 ······················································································ (53)
4.1 Python 内置的标准模块 ··············································································· (53)
4.1.1 通过 help()命令查看内置模块 ···································································· (53)
4.1.2 通过 IDLE 的【Help】菜单查看内置模块 ····················································· (58)
4.1.3 常用内置模块及其功能介绍 ······································································ (59)
4.1.4 内置模块的主要函数(方法)简介 ····························································· (60)
4.2 内置模块的应用举例 ··················································································· (66)
4.2.1 与路径相关的应用举例 ············································································ (66)
4.2.2 与时间相关的应用举例 ············································································ (67)
4.3 Python 的内置函数 ······················································································ (68)
4.3.1 如何查看 Python 有哪些内置函数 ······························································· (68)
4.3.2 内置函数及其功能 ·················································································· (69)
4.3.3 内置函数的应用举例 ··············································································· (72)
思考与实践 ········································································································· (75)
第 5 章 Python 的外部资源 ······················································································ (76)
5.1 为什么要安装外部模块 ··············································································· (76)
5.2 如何安装外部模块 ······················································································ (77)
5.2.1 升级安装工具 ························································································ (77)
5.2.2 使用 pip 安装外部模块 ············································································· (79)
5.2.3 使用 easy_install 安装外部模块 ·································································· (81)
5.3 将安装后的外部模块导入 PyCharm 中 ························································· (83)
5.4 通过 PyCharm 安装外部模块 ······································································· (86)
5.4.1 通过 Project Interpreter 方式安装外部模块 ····················································· (87)
5.4.2 通过 Plugins 方式安装外部模块 ·································································· (92)
5.5 常用的外部模块及其应用 ············································································ (93)
5.5.1 常用的外部模块 ····················································································· (93)
5.5.2 外部模块的应用举例 ··············································································· (94)
思考与实践 ········································································································· (95)
第 2 篇 掀起盖头
第 6 章 我的 Python 处女作 ····················································································· (97)
6.1 新建工程 ···································································································· (97)
6.1.1 新建工程文件 ························································································ (97)
6.1.2 新建 Python 文件 ··················································································· (100)
6.1.3 配置工程并运行 ···················································································· (101)
6.2 关于工程及其要注意的 3 个事项 ································································ (102)
6.2.1 关于首次运行程序的注意事项 ·································································· (102)
6.2.2 关于工程的必要设置 ·············································································· (103)
6.2.3 关于运行与调试功能的设置问题 ······························································· (106)
6.2.4 关于 3 种运行方式 ················································································· (108)
思考与实践 ········································································································ (110)
第 7 章 Python 的数据类型 ····················································································· (111)
7.1 Python 程序的基本组成 ·············································································· (111)
7.1.1 一个温度转换的例子 ·············································································· (111)
7.1.2 程序的注释 ·························································································· (112)
7.1.3 语句 ··································································································· (113)
7.1.4 常量 ··································································································· (115)
7.1.5 变量 ··································································································· (117)
7.1.6 标识符 ································································································ (118)
7.1.7 函数 ··································································································· (118)
7.2 Python 的数据类型及其有关特性 ································································ (119)
7.2.1 Python 的数据类型分类 ··········································································· (119)
7.2.2 Python 变量的基本特性 ··········································································· (120)
7.3 Python 中的常量 ························································································ (121)
7.3.1 数字 ··································································································· (121)
7.3.2 字符串 ································································································ (123)
7.3.3 布尔值 ································································································ (125)
7.3.4 空值 ··································································································· (125)
7.4 Python 中的基本类型变量··········································································· (127)
7.4.1 变量的使用 ·························································································· (127)
7.4.2 基本变量的赋值 ···················································································· (127)
7.4.3 变量的地址 ·························································································· (128)
7.5 Python 中的构造类型变量··········································································· (129)
7.5.1 字符串 ································································································ (129)
7.5.2 列表 ··································································································· (132)
7.5.3 元组 ··································································································· (134)
7.5.4 集合 ··································································································· (137)
7.5.5 字典 ··································································································· (139)
7.6 归纳与总结 ································································································ (141)
7.6.1 各种类型的相互转换 ·············································································· (141)
7.6.2 字符串、列表、元组、字典和集合的异同点 ················································ (142)
思考与实践 ········································································································ (143)
第 8 章 Python 的数据运算 ····················································································· (144)
8.1 运算符的分类 ···························································································· (144)
8.2 运算符的功能与特点 ·················································································· (145)
8.2.1 算术运算符 ·························································································· (145)
8.2.2 比较运算符 ·························································································· (146)
8.2.3 赋值运算符 ·························································································· (147)
8.2.4 逻辑运算符 ·························································································· (149)
8.2.5 成员运算符 ·························································································· (150)
8.2.6 身份运算符 ·························································································· (151)
8.2.7 位运算符 ····························································································· (153)
8.3 运算符的优先级 ························································································· (155)
8.3.1 优先级与结合性 ···················································································· (155)
8.3.2 优先级的使用举例 ················································································· (157)
思考与实践 ········································································································ (158)
第 9 章 键盘输入与屏幕输出 ··················································································· (159)
9.1 键盘输入与 input()函数 ·············································································· (159)
9.1.1 input()函数的功能 ·················································································· (159)
9.1.2 数据类型之间的转换 ·············································································· (160)
9.2 屏幕输出与 print()函数 ··············································································· (162)
9.2.1 print()函数的功能 ·················································································· (162)
9.2.2 print()函数的 3 种使用形式 ······································································ (163)
9.3 练一练:通用倒计时器 ·············································································· (172)
9.3.1 程序设计要求与具体程序 ········································································ (172)
9.3.2 程序的两种运行方式 ·············································································· (173)
9.4 归纳与总结 ································································································ (175)
思考与实践 ········································································································ (176)
第 10 章 学会选择靠 if 语句 ···················································································· (177)
10.1 选择问题与 if 语句 ··················································································· (177)
10.2 if 语句的 3 种语法形式 ············································································· (178)
10.2.1 if 语句的第一种语法形式 ······································································· (178)
10.2.2 if 语句的第二种语法形式 ······································································· (180)
10.2.3 if 语句的第三种语法形式 ······································································· (182)
10.3 多重 if 语句与 if 语句的嵌套 ····································································· (184)
10.4 关于 if 语句的重要小结 ············································································ (186)
10.5 练一练——正整数分离 ············································································· (188)
思考与实践 ········································································································ (190)
第 11 章 重复操作与循环语句 ················································································· (191)
11.1 循环及其应用 ··························································································· (191)
11.2 while 和 for 语句 ······················································································· (192)
11.2.1 while 语句 ·························································································· (192)
11.2.2 for 语句 ····························································································· (193)
11.3 break 和 continue 语句 ··············································································· (196)
11.4 练一练——摄氏与华氏温度转换 ······························································· (198)
11.4.1 程序设计要求与具体程序 ······································································· (198)
11.4.2 程序的详细分析 ··················································································· (201)
11.5 归纳与总结 ······························································································ (204)
11.5.1 循环语句 for 与 while 的 else 扩展 ···························································· (204)
11.5.2 break 与 continue 语句的区别 ·································································· (205)
思考与实践 ········································································································ (206)
第 12 章 函数让程序优雅 ························································································ (207)
12.1 什么是函数 ······························································································ (207)
12.1.1 函数的概念 ························································································· (207)
12.1.2 为什么要使用函数 ················································································ (208)
12.2 函数的定义与调用 ···················································································· (209)
12.2.1 如何定义一个函数 ················································································ (209)
12.2.2 如何调用函数 ······················································································ (211)
12.3 函数的参数传递与不定长参数 ·································································· (213)
12.3.1 不可变类型参数的传递与可变类型参数的传递 ············································ (213)
12.3.2 必须参数、默认参数与关键词参数 ··························································· (215)
12.3.3 不定长参数 ························································································· (218)
12.4 匿名函数·································································································· (223)
12.5 变量的作用范围 ······················································································· (224)
12.6 练一练——“剪刀、石头、布”游戏 ························································ (225)
12.6.1 程序设计要求与算法设计 ······································································· (225)
12.6.2 完整程序与运行结果 ············································································· (227)
12.7 归纳与总结 ······························································································ (231)
12.7.1 函数的意义 ························································································· (231)
12.7.2 return 语句 ·························································································· (231)
12.7.3 关于默认参数 ······················································································ (232)
12.7.4 if __name__ =='__main__'的作用 ······························································ (233)
思考与实践 ········································································································ (234)
第 13 章 “分而治之”与程序的模块化 ··································································· (235)
13.1 模块化及其意义 ······················································································· (235)
13.1.1 为什么要模块化 ··················································································· (235)
13.1.2 什么是模块 ························································································· (236)
13.2 如何定义和使用模块 ················································································ (237)
13.2.1 中模块——文件模块的定义与应用 ··························································· (238)
13.2.2 模块是如何被找到并引用的——模块搜索路径 ············································ (243)
13.3 大模块——包的定义与应用 ······································································ (245)
13.3.1 什么是“包” ······················································································ (245)
13.3.2 如何定义包 ························································································· (246)
13.3.3 包的使用 ···························································································· (253)
13.4 归纳与总结 ······························································································ (256)
思考与实践 ········································································································ (257)
第 14 章 文件与数据格式化 ···················································································· (258)
14.1 文件及其操作 ··························································································· (258)
14.1.1 文件概述 ···························································································· (258)
14.1.2 打开文件——open()函数 ········································································ (259)
14.1.3 打开文件举例 ······················································································ (270)
14.1.4 读文件 ······························································································· (271)
14.1.5 写文件 ······························································································· (274)
14.1.6 文件指针及其移动 ················································································ (276)
14.1.7 关闭文件 ···························································································· (277)
14.2 文件的应用举例——词频统计 ·································································· (277)
14.2.1 英文文献的词频统计 ············································································· (277)
14.2.2 jieba 模块与中文文献的词频统计 ····························································· (279)
14.3 CSV 格式文件与 JSON 格式文件的操作 ···················································· (281)
14.3.1 CSV 格式文件及其操作 ········································································· (281)
14.3.2 JSON 格式文件及其操作 ········································································ (283)
14.4 归纳与总结 ······························································································ (286)
14.4.1 关于文件的几点注意事项 ······································································· (286)
14.4.2 文件的迭代 ························································································· (288)
思考与实践 ····································································································· (289)
第 15 章 面向对象与类——让程序更人性化 ···························································· (290)
15.1 面向对象与类 ··························································································· (290)
15.1.1 面向过程的程序设计 ············································································· (290)
15.1.2 面向对象的程序设计 ············································································· (291)
15.1.3 类 ····································································································· (292)
15.2 类的定义·································································································· (292)
15.2.1 类的定义与__init__()方法 ······································································· (292)
15.2.2 实例方法、类方法和静态方法 ································································· (295)
15.2.3 实例变量与类变量 ················································································ (298)
15.2.4 私有属性和私有方法 ············································································· (300)
15.3 类的使用·································································································· (304)
15.3.1 不带默认属性的类及其使用 ···································································· (304)
15.3.2 带默认属性的类及其使用 ······································································· (306)
15.3.3 类的组合使用 ······················································································ (308)
15.4 类的封装性 ······························································································ (310)
15.4.1 什么是封装 ························································································· (310)
15.4.2 如何封装 ···························································································· (310)
15.5 类的继承性 ······························································································ (318)
15.5.1 什么是继承 ························································································· (318)
15.5.2 类的单继承 ························································································· (319)
15.5.3 构造函数的继承 ··················································································· (321)
15.5.4 类的多继承 ························································································· (324)
15.5.5 类的多级继承 ······················································································ (328)
15.5.6 类的混合继承 ······················································································ (329)
15.6 类的多态性 ······························································································ (331)
15.6.1 什么是多态性 ······················································································ (331)
15.6.2 多态性举例 ························································································· (332)
15.7 从模块中导入类 ······················································································· (334)
15.8 归纳与总结 ······························································································ (336)
15.8.1 类方法的属性化 ··················································································· (336)
15.8.2 关于内置变量__mro__ ··········································································· (338)
15.8.3 关于内置函数 issubclass()与 isinstance() ····················································· (340)
15.8.4 关于内置函数 dir() ··············································································· (340)
思考与实践 ········································································································ (341)
第 16 章 异常处理让程序健壮 ················································································· (342)
16.1 错误与异常 ······························································································ (342)
16.1.1 错误(Error) ····················································································· (342)
16.1.2 异常(Exception) ··············································································· (346)
16.1.3 常见的标准异常 ··················································································· (347)
16.1.4 自定义异常 ························································································· (350)
16.1.5 为什么要进行异常处理 ·········································································· (352)
16.2 异常处理的一般方法——try 语句 ······························································ (354)
16.2.1 try 语句的一般语法 ·············································································· (354)
16.2.2 try 语句的执行过程分析 ········································································ (355)
16.3 异常处理的特殊方法——with 语句 ··························································· (363)
16.3.1 上下文管理 ························································································· (363)
16.3.2 为什么要使用 with 语句 ········································································· (364)
16.3.3 with 语句的一般形式 ············································································ (365)
16.3.4 with 语句的工作机制 ············································································ (365)
16.3.5 自定义上下文管理器 ············································································· (367)
16.3.6 以 Socket 通信举例说明上下文管理器的定义 ·············································· (369)
16.4 归纳与总结 ······························································································ (373)
16.4.1 关于 try 语句 ······················································································· (373)
16.4.2 关于异常的其他问题 ············································································· (374)
16.4.3 关于 Socket 通信的再说明 ······································································ (375)
思考与实践 ········································································································ (376)
第 3 篇 实战演习
第 17 章 桌面小游戏—剪刀、石头、布 ······························································· (378)
17.1 图形化人机界面 GUI 及其应用 ································································· (378)
17.2 基于 GUI 的“剪刀、石头、布”游戏的算法与类的设计 ··························· (380)
17.2.1 算法设计 ···························································································· (380)
17.2.2 类的设计 ···························································································· (382)
17.2.3 计算机出拳的实现 ················································································ (385)
17.2.4 最高得分的保存与读取 ·········································································· (386)
17.2.5 图形化界面 ························································································· (389)
17.2.6 按键和鼠标的捕捉与处理 ······································································· (390)
17.3 编辑程序·································································································· (392)
17.3.1 新建 PyCharm 工程 ··············································································· (392)
17.3.2 完整的源程序 ······················································································ (398)
17.3.3 程序运行效果 ······················································································ (405)
17.4 归纳与总结 ······························································································ (406)
17.4.1 设置解释器时出现“Cannot Save Settings”错误及其解决办法 ························ (406)
17.4.2 将代码生成可执行文件 ·········································································· (407)
思考与实践 ··································································································· (410)
第 18 章 数据挖掘与分析—Bilibili 视频爬虫 ························································· (411)
18.1 数据挖掘与网络爬虫 ················································································ (411)
18.1.1 数据挖掘 ···························································································· (411)
18.1.2 网络爬虫 ···························································································· (412)
18.1.3 网络爬虫的工作原理 ············································································· (413)
18.1.4 实现网络爬虫的关键技术 ······································································· (415)
18.1.5 爬虫的基本框架 ··················································································· (425)
18.1.6 反爬虫与 Robots 协议 ············································································ (427)
18.2 Python 网络爬虫的开发平台与环境 ··························································· (431)
18.3 爬虫的案例—B 站网络爬虫 ·································································· (432)
18.3.1 功能与设计要求 ··················································································· (432)
18.3.2 目标 URL 和应用接口的获取 ·································································· (433)
18.3.3 举例:如何快速找到 B 站全站视频信息的公共接口(API) ·························· (438)
18.3.4 算法与流程图 ······················································································ (439)
18.3.5 多进程与多线程的选择 ·········································································· (442)
18.3.6 完整的程序代码 ··················································································· (446)
18.4 归纳与总结 ······························································································ (451)
18.4.1 关于 requests 中 get()方法的几点注意事项 ·················································· (451)
18.4.2 爬虫尺寸 ···························································································· (452)
18.4.3 反爬虫技术 ························································································· (452)
思考与实践 ········································································································ (453)
第 19 章 图像识别与机器学习—字符型验证码自动识别 ······································· (454)
19.1 机器视觉与机器学习 ················································································ (454)
19.1.1 机器视觉 ···························································································· (454)
19.1.2 机器学习 ···························································································· (455)
19.1.3 机器学习与神经网络 ············································································· (456)
19.2 TensorFlow 及其卷积神经网络 ·································································· (457)
19.2.1 TensorFlow 及其介绍 ············································································ (457)
19.2.2 TensorFlow 的程序举例 ········································································· (459)
19.2.3 基于 TensorFlow 的卷积神经网络 ····························································· (460)
19.3 字符型验证码的自动识别 ········································································· (463)
19.3.1 字符型验证码 ······················································································ (463)
19.3.2 自动识别字符型验证码的两种方法 ··························································· (463)
19.4 字符型验证码自动识别程序的实现 ··························································· (465)
19.4.1 字符型验证码自动识别程序的算法设计 ····················································· (465)
19.4.2 字符型验证码自动识别程序架构 ······························································ (466)
19.4.3 字符型验证码自动识别程序 ···································································· (468)
19.4.4 程序运行结果及其分析 ·········································································· (483)
19.5 归纳与总结 ······························································································ (485)
19.5.1 关于 CNN 模型 ···················································································· (485)
19.5.2 关于 TensorFlow 的一些问题 ··································································· (487)
19.5.3 关于深度学习框架的问题 ······································································· (491)
思考与实践 ········································································································ (492)
第 20 章 智能控制—基于串口控制的二极管花样显示 ·········································· (493)
20.1 项目的设计目标 ······················································································· (493)
20.1.1 项目设计要求 ······················································································ (493)
20.1.2 串口及其设置 ······················································································ (494)
20.2 Pyboard 开发板及其应用 ·········································································· (497)
20.2.1 Pyboard 开发板 ···················································································· (497)
20.2.2 Pyboard 开发板的安装 ··········································································· (498)
20.2.3 Pyboard 开发板的控制方式 ····································································· (499)
20.2.4 Pyboard 开发板与上位机的串口通信测试 ··················································· (501)
20.3 发光二极管显示板 ···················································································· (502)
20.4 项目的算法及其分析 ················································································ (504)
20.4.1 上位机程序的算法 ················································································ (504)
20.4.2 下位机程序的算法 ················································································ (505)
20.5 项目的程序 ······························································································ (505)
20.5.1 上位机程序 ························································································· (505)
20.5.2 下位机程序 ························································································· (508)
20.6 实际运行效果及其分析 ············································································· (512)
20.6.1 样机及其运行演示 ················································································ (512)
20.6.2 程序运行要点 ······················································································ (513)
20.6.3 Pyboard 开发板的资源 ··········································································· (514)
20.7 归纳与总结 ······························································································ (516)
思考与实践 ····································································································· (516)
第 4 篇 继续前进
第 21 章 程序的调试、测试与断言 ········································································ (518)
21.1 程序的调试与测试 ···················································································· (518)
21.1.1 程序调试的方法 ··················································································· (518)
21.1.2 使用 Python 内置单步调试器(Pdb)调试程序 ············································ (522)
21.1.3 利用 IDE 集成开发环境调试程序 ····························································· (525)
21.2 程序测试的方法 ······················································································· (525)
21.2.1 为什么要对程序进行测试 ······································································· (525)
21.2.2 通过 unittest 实现一般测试 ····································································· (526)
21.2.3 使用 TestSuite 进行测试 ········································································ (530)
21.3 归纳与总结 ······························································································ (535)
思考与实践 ······································································································ (535)
第 22 章 Python 程序的打包与发布 ····································································· (536)
22.1 为什么要将程序打包 ················································································ (536)
22.2 如何将程序打包 ······················································································· (537)
22.2.1 打包成.pyc 文件 ··················································································· (537)
22.2.2 Python 程序的运行过程 ········································································· (540)
22.2.3 打包成.exe 文件 ··················································································· (541)
22.3 归纳与总结 ······························································································ (544)
思考与实践 ······································································································ (545)
第 23 章 Python 那些不得不说的事情 ··································································· (546)
23.1 如何使程序更 Pythonic ············································································· (546)
23.1.1 Python 程序的基本原则 ········································································· (546)
23.1.2 交换变量值(Swap Values) ·································································· (548)
23.1.3 合并字符串 ························································································· (549)
23.1.4 使用关键字 in ····················································································· (550)
23.1.5 Python 的 True 值(Truth Value) ····························································· (551)
23.1.6 enumerate—索引和元素(Index & Item) ················································ (552)
23.1.7 Python 方法中参数的默认值 ··································································· (553)
23.2 迭代器 ····································································································· (554)
23.2.1 迭代器及其应用 ··················································································· (554)
23.2.2 列表生成式 ························································································· (556)
23.3 生成器 ····································································································· (557)
23.3.1 生成器及其应用 ··················································································· (557)
23.3.2 yield 及其使用 ····················································································· (558)
23.4 归纳与总结 ······························································································ (560)
思考与实践 ········································································································ (561)
后记 ························································································································· (562)
致谢 ························································································································· (563)
参考文献 ·················································································································· (564)




------分隔线----------------------------

锋哥公众号


锋哥微信


关注公众号
【Java资料站】
回复 666
获取 
66套java
从菜鸡到大神
项目实战课程

锋哥推荐