Python 3 Programming
Tags
Summary
Editor's review
As a commonly used textbook for university computer science courses or related programs, the book is characterized by its clear structure and step-by-step progression. Each concept is accompanied by concise sample code and exercises that help readers consolidate what they have learned. Its depth is moderate: it avoids the superficiality of broad but shallow coverage, yet does not get bogged down in the details of complex project development. For beginners seeking to build a solid foundation in Python programming, it offers a steady and reliable learning path.
From an editorial perspective, the book's value lies in its textbook-like rigor and completeness. It does not chase fashionable frameworks or flashy tricks; instead, it focuses on building a solid foundation for programming thinking. For self-learners, it can serve as a systematic learning map; for students, it is excellent supplementary reading for classroom study. The book's brief introduction to algorithm fundamentals and software engineering ideas also prepares readers for further study in areas such as data analysis and web development. Of course, technical books inevitably lag behind the latest versions, so readers should consult the latest official documentation to keep up with minor updates to language features.
Who it's for
A good fit for
- Lower-year undergraduate students in computer science or related majors seeking a structured course companion textbook.
- Self-learners with no programming background who want to learn Python systematically from their first line of code.
- Developers switching languages who need a quick refresher on Python's core syntax and programming concepts.
- Professionals in non-technical roles who want to improve work efficiency (e.g., office automation) by learning Python.
Not a good fit for
- Experienced developers seeking to learn the latest advanced Python features (e.g., asynchronous programming, in-depth use of type annotations).
- Impatient learners who prefer to learn directly through hands-on projects (e.g., machine learning, large-scale web applications).
Reading tips
- Study the chapters in order, and be sure to type in and run every sample code to understand its output.
- The exercises at the end of each chapter are key to checking your learning; complete them independently even if they seem easy.
- Organize core concepts (e.g., list comprehensions, decorators, classes and objects) into your own notes or mind maps.
- When studying the later sections on networking, databases, and other topics, consult more specialized materials or official documentation as needed for supplementation.
About the publisher
Posts & Telecom Press is known for its strengths in science and technology, computing, and information and communications titles, and has extended its publishing into photography, art, software learning, and inspirational growth, giving it a fairly diverse range. Its catalog includes computing and communications works such as Refactoring and Patterns (Revised Edition) and Huawei Switch Learning Guide (Second Edition), alongside bilingual collector's editions such as The Little Prince (Chinese-English-French illustrated collector's edition), The Great Gatsby, and Three Days to See. Beijing Ten Years: 1980-1990 and Ghost Blade: WLOP Personal Illustration Collection reflect its presence in photography and art. Its authors include Antoine de Saint-Exupéry, Helen Keller, Joshua Kerievsky, Wang Da, Zhang Zhaozeng, and WLOP.
Contents
- 版权信息
- 内容提要
- 前言
- 第1章 初识Python
- 1.1 程序设计语言
- 1.1.1 程序设计语言的概念
- 1.1.2 编译与解释
- 1.2 Python语言
- 1.2.1 Python的历史
- 1.2.2 Python的特点
- 1.2.3 Python的应用
- 1.3 Python的开发环境
- 1.3.1 下载和安装Python
- 1.3.2 内置的IDLE开发环境
- 1.3.3 PyCharm集成开发环境
- 1.4 Python程序的运行
- 1.4.1 Python程序的运行原理
- 1.4.2 建立和运行Python程序
- 1.5 Python编程方法与应用
- 1.5.1 程序设计方法
- 1.5.2 程序示例
- 1.5.3 Python的帮助文档
- 本章小结
- 习题1
- 第2章 Python基础知识
- 2.1 程序的书写规范
- 2.1.1 Python的语句
- 2.1.2 代码块与缩进
- 2.1.3 注释
- 2.2 标识符和关键字
- 2.2.1 标识符
- 2.2.2 关键字
- 2.3 Python的数据类型
- 2.4 Python的变量
- 2.5 Python的运算符
- 2.5.1 算术运算符
- 2.5.2 比较运算符
- 2.5.3 逻辑运算符
- 2.5.4 赋值运算符
- 2.5.5 位运算符
- 2.6 运算符的优先级
- 本章小结
- 习题2
- 第3章 Python中的字符串
- 3.1 字符串的表示
- 3.2 字符串的格式化
- 3.2.1 用%操作符格式化字符串
- 3.2.2 format()方法
- 3.3 字符串的操作符
- 3.4 字符串处理函数
- 3.5 输入/输出语句
- 3.5.1 输入语句
- 3.5.2 输出语句
- 本章小结
- 习题3
- 第4章 Python程序的流程
- 4.1 程序设计流程
- 4.1.1 程序流程图
- 4.1.2 结构化程序设计的基本流程
- 4.2 分支结构
- 4.3 循环结构
- 4.3.1 遍历循环:for语句
- 4.3.2 条件循环:while语句
- 4.3.3 循环的嵌套
- 4.4 流程控制的其他语句
- 4.4.1 跳转语句
- 4.4.2 pass语句
- 4.4.3 循环结构中的else语句
- 4.5 流程控制语句的应用
- 本章小结
- 习题4
- 第5章 Python的组合数据类型
- 5.1 序列类型
- 5.2 列表
- 5.2.1 列表的基本操作
- 5.2.2 列表的方法
- 5.2.3 遍历列表
- 5.3 元组
- 5.3.1 元组的基本操作
- 5.3.2 元组与列表的转换
- 5.4 字典
- 5.4.1 字典的基本操作
- 5.4.2 字典的常用方法
- 5.5 集合
- 5.5.1 集合的基本操作
- 5.5.2 集合运算
- 5.6 组合数据类型的应用
- 本章小结
- 习题5
- 第6章 用函数实现代码复用
- 6.1 函数的定义和调用
- 6.1.1 函数的定义
- 6.1.2 函数的调用
- 6.1.3 函数的嵌套
- 6.2 函数的参数和返回值
- 6.2.1 函数的参数
- 6.2.2 默认参数
- 6.2.3 可变参数
- 6.2.4 函数的返回值
- 6.2.5 lambda函数
- 6.3 闭包和递归函数
- 6.3.1 闭包*
- 6.3.2 递归函数
- 6.4 变量的作用域
- 6.4.1 局部变量
- 6.4.2 全局变量
- 6.4.3 global语句
- 6.5 Python的内置函数
- 6.5.1 数学运算函数
- 6.5.2 字符串运算函数
- 6.5.3 转换函数
- 6.5.4 序列操作函数
- 6.5.5 Python操作相关函数
- 本章小结
- 习题6
- 第7章 用类实现抽象和封装*
- 7.1 面向对象编程概述
- 7.1.1 面向对象编程的概念
- 7.1.2 面向对象编程的特点
- 7.2 创建类与对象
- 7.2.1 创建类
- 7.2.2 创建对象
- 7.3 构造方法和析构方法
- 7.3.1 构造方法
- 7.3.2 析构方法
- 7.3.3 self参数
- 7.3.4 成员变量和类变量
- 7.3.5 类方法和静态方法
- 7.4 类的继承
- 7.4.1 继承的实现
- 7.4.2 方法重写
- 7.4.3 Python的多继承
- 7.5 类的多态
- 7.6 运算符重载
- 7.7 面向对象编程的应用
- 本章小结
- 习题7
- 第8章 使用模块和库编程
- 8.1 模块
- 8.1.1 模块的概念
- 8.1.2 导入模块
- 8.1.3 执行模块
- 8.1.4 模块搜索路径
- 8.1.5 __name__属性
- 8.2 包
- 8.3 Python的标准库
- 8.3.1 math库
- 8.3.2 random库
- 8.3.3 datetime库
- 8.4 Python的第三方库
- 8.4.1 第三方库简介
- 8.4.2 使用pip工具安装第三方库
- 8.4.3 Python常用的第三方库
- 8.4.4 使用pyinstaller库打包文件
- 8.5 turtle库的应用
- 8.6 jieba库的应用
- 8.6.1 jieba库简介
- 8.6.2 jieba库的分词函数
- 8.6.3 添加单词和自定义词典
- 8.6.4 基于TF-IDF算法的关键词抽取
- 8.6.5 中文文本的词频统计
- 8.6.6 打包词频统计程序
- 本章小结
- 习题8
- 第9章 Python的文件操作
- 9.1 文件的概念
- 9.2 文件的打开与关闭
- 9.3 文件的读/写操作
- 9.3.1 读取文件数据
- 9.3.2 向文件写数据
- 9.3.3 文件的定位读/写
- 9.3.4 读/写二进制文件
- 9.4 文件和目录操作
- 9.4.1 常用的文件操作函数
- 9.4.2 文件的复制、删除及重命名操作
- 9.4.3 文件的目录操作
- 9.5 使用CSV文件格式读/写数据
- 9.5.1 CSV文件介绍
- 9.5.2 读/写CSV文件
- 9.6 文件操作的应用
- 本章小结
- 习题9
- 第10章 异常处理
- 10.1 异常处理概述
- 10.1.1 异常的概念
- 10.1.2 异常示例
- 10.2 Python的异常类
- 10.3 异常处理机制
- 10.3.1 try…except语句
- 10.3.2 else语句和finally语句
- 10.3.3 捕获所有的异常
- 10.4 抛出异常
- 10.4.1 raise语句
- 10.4.2 抛出异常示例
- 10.5 断言与上下文管理
- 10.5.1 断言
- 10.5.2 上下文管理
- 10.6 自定义异常
- 本章小结
- 习题10
- 第11章 tkinter GUI编程
- 11.1 tkinter编程概述
- 11.1.1 第一个tkinter GUI程序
- 11.1.2 设置窗口和组件的属性
- 11.2 tkinter GUI的布局管理
- 11.2.1 使用pack()方法的布局
- 11.2.2 使用grid()方法的布局
- 11.2.3 使用place()方法的布局
- 11.2.4 使用框架的复杂布局
- 11.3 tkinter的常用组件
- 11.3.1 Label组件
- 11.3.2 Button组件
- 11.3.3 Entry组件
- 11.3.4 Listbox组件
- 11.3.5 Radiobutton组件
- 11.3.6 Checkbutton组件
- 11.3.7 Text组件
- 11.3.8 Spinbox组件
- 11.4 tkinter的事件处理
- 11.4.1 使用command参数实现事件处理
- 11.4.2 使用组件的bind()方法实现事件处理
- 11.5 tkinger GUI的应用
- 本章小结
- 习题11
- 第12章 Python的数据库编程
- 12.1 数据库的基础知识
- 12.1.1 数据库的概念
- 12.1.2 关系型数据库
- 12.1.3 Python的SQLite3模块
- 12.2 SQLite数据库
- 12.2.1 SQLite数据库简介
- 12.2.2 下载和安装SQLite数据库
- 12.2.3 SQLite3的常用命令
- 12.2.4 SQLite3的数据类型
- 12.2.5 SQLite3模块中的对象
- 12.2.6 SQLite3的函数
- 12.2.7 创建SQLite3数据库
- 12.3 关系数据库语言SQL
- 12.3.1 数据表的建立和删除
- 12.3.2 向表中添加列
- 12.3.3 向表中插入数据
- 12.3.4 修改表中的数据
- 12.3.5 删除数据
- 12.3.6 查询数据
- 12.4 Python的SQLite3编程
- 12.4.1 访问数据库的步骤
- 12.4.2 创建数据库和表
- 12.4.3 数据库的插入、更新和删除操作
- 12.5 SQLite编程的应用
- 本章小结
- 习题12
- 第13章 科学计算与图表绘制
- 13.1 用于科学计算的numpy库
- 13.1.1 numpy简介
- 13.1.2 numpy数组的创建
- 13.1.3 访问numpy数组的元素
- 13.1.4 numpy数组的算术运算
- 13.1.5 numpy数组的形状操作
- 13.2 用于绘制图表的matplotlib库
- 13.2.1 matplotlib简介
- 13.2.2 matplotlib.pyplot库中的函数
- 13.2.3 绘制直方图、条形图、饼状图
- 本章小结
- 习题13
- 第14章 爬取与分析网页中的数据
- 14.1 爬取网页的urllib和requests库
- 14.1.1 爬取网页的基础知识
- 14.1.2 urllib库
- 14.1.3 requests库
- 14.2 解析网页的beautifulsoup4库
- 14.2.1 beautifulsoup4库概述
- 14.2.2 beautifulsoup4库的对象
- 14.2.3 beautifulsoup4库操作解析文档树
- 14.3 网页爬取技术的应用
- 14.3.1 爬取单一网页页面的信息
- 14.3.2 爬取来自多个页面的信息
- 本章小结
- 习题14
- 参考文献
FAQ
Is this book suitable for someone with no programming experience at all?
Which Python version is the code in this book based on?
What level will I reach after finishing this book?
Comments
Find this book
This site is an index: you start “Search all sources” in your browser, and the entries it lists all point to third-party sites; please judge their availability yourself.
About the author
Tang Yonghua: publicly available information is currently limited, and details of the author's life, nationality, and educational background cannot be confirmed. According to the library's holdings, Tang Yonghua has one work, Python 3 Programming Design, classified under programming design and intended as a book on the Python 3 language and program design. It can therefore be inferred that the author's writing focuses on introductory programming and foundational practice, covering Python 3 syntax, program structure, and design methods, and is aimed mainly at beginners and learners who need a systematic review of the basics. Because more verifiable information is lacking, it is not possible to further describe the author's professional experience, research direction, or academic background. On the available evidence, Tang Yonghua's contribution lies chiefly in this textbook-style work, which helps readers build a basic framework for Python programming through a fairly systematic arrangement and offers a reference learning path among comparable introductory books. More public information would be welcome for a fuller account of the author and the work.
Liu Deshan is an author writing in computer-related fields, though publicly available information about him is limited, and details of his life and background cannot be verified. Judging from the four works held in the collection, his writing focuses on two areas: web front-end development and programming. These include HTML5+CSS3 Web Front-End Development Technology and its second edition, as well as Python 3 Programming. He has also addressed software design methods in Java Design Patterns and Application Cases (2nd Edition). Categorized under computer basics, programming design, and examinations, these works cover both practical web page construction and scripting languages, and the application of object-oriented patterns, reflecting an approach that combines foundational introductions with engineering practice. They are suitable as course textbooks or self-study references. Given the lack of biographical material, his writing style and actual influence are difficult to assess in detail.
Li Ling's publicly available information is limited, yet her writing and editorial work cover a notably broad range. The library holds thirteen of her titles, spanning biography, examination preparation, social culture, medicine, history, and finance. In biography, she has written the three-volume collection Meilanfang Fei as well as the standalone volume Meilanfang Fei: Mei Lanfang in Japan, both centering on the Peking opera master Mei Lanfang's experiences abroad; she is also the author of One Who Refuses to Be a Slave: A Biography of Nie Er, a life of the musician Nie Er. Her practical and instructional works include a cake decorating tutorial, Calculus (Volume One), an experimental guide for materials science, and a pre-service training manual for caregivers. She has also contributed to lighthearted popular history such as Ancient People Knew Better How to Have Fun. Judging from these titles, she handles both historical research and textbooks or popular writing with a practical style aimed at different readerships.