Python Programming from 0 to 1 (Video Edition) cover

Python Programming from 0 to 1 (Video Edition)

No rating yet
Word count
480K words
Chapters
32
ISBN
9787111632955

Tags

Summary

Compiled by Zhang Di, this book uses Python 3 as its platform and follows the teaching system of an "Introduction to Programming" course. Its goal is to help readers with no or weak programming background build a complete framework of programming knowledge and to treat Python as a tool for understanding the essence of programming, rather than learning isolated syntax points. The book has four chapters. Chapter 1 covers the basics: starting from Python's history and expressions, it introduces interactive execution mode and running scripts, built-in types (literals, constructors, containers, indexing and slicing), assignment and references, control flow structures, input/output and formatting, and then demonstrates basic methods through examples such as printing a pyramid, the 3X+1 problem, drawing regular polygons and function curves, and the Monte Carlo method; it also discusses the "program execution model," including stateless programs, stateful programs, linear memory, and designing programs with stacks and queues, and concludes with an overview of algorithm performance, exception handling, and PDB debugging. Chapter 2 centers on functions, covering function definition and calls, lambda expressions, callbacks, closures, parameter passing, modules and packages, scope and stack frames, recursion (including the Koch snowflake, binary tree traversal, eliminating tail recursion, and dynamic programming), and introduces classes and instance methods, higher-order functions and decorators, and the iterator and generator patterns. Chapter 3 uses built-in types to analyze data structures: list memory layout with insertion sort and binary search, linked lists and stack/queue implementations, hash tables and dictionaries, binary trees (traversal, binary search trees, binary heaps and priority queues, Huffman coding), and case studies of deque and OrderedDict at the source-code level; the final section uses a pathfinding problem to connect graph representation, Dijkstra's algorithm, and the A* algorithm. Chapter 4 covers object orientation: classes, static methods and class methods, private members, the property decorator, instance lifecycles and object copying, inheritance and polymorphism, class design, multiple inheritance and duck typing, and finally a PyQt GUI program as a comprehensive exercise. Most code examples in the book can run directly, and teaching videos, example source code, and courseware accompany the text.

Editor's review

市面上多数 Python 入门书止步于“语法讲完”,这本书却把重心放在程序设计的“内功”上:表达式为什么这么执行、变量赋值背后的引用关系、程序状态如何被栈与队列组织、递归为什么会慢又该如何消除、列表与链表的真实内存代价差别在哪。作者张頔毕业于清华大学电子工程系,有十余年 IT 领域教学经验,全书按“教科书设定”编排:第 1 章打好通用编程方法,第 2 章讲透函数与递归,第 3 章借内建类型深入数据结构,第 4 章落到面向对象并以 PyQt 界面程序收尾,四章形成一条完整的进阶路径。书中示例大多可直接运行,配套教学视频、源码与课件,适合在有人指导的课堂里使用,也适合愿意动手敲代码的自学者。需要注意的是,本书不教环境安装与编辑器配置,零基础读者需先自行装好 Python;另外书中部分细节存在争议与勘误,遇到可疑之处建议以官方文档和实测结果为准。

Who it's for

A good fit for

  • 高校理工科专业把 Python 作为第一门程序设计课的学生
  • 学过一点编程、想系统补齐程序设计基础的读者
  • IT 培训机构 Python 课程的学习者与讲师
  • 希望从语法层面深入到编程模型与数据结构的自学者

Not a good fit for

  • 完全没装过 Python、需要手把手教环境搭建的纯零基础读者
  • 想直接做数据分析、爬虫、机器学习项目实战的读者
  • 只想速查语法、当作案头速查手册使用的读者

Reading tips

  1. 读前先自行安装 Python 3 并按书中方式跑通交互模式与脚本,否则第 1 章会卡住。
  2. 第 1 章的示例与练习务必亲手敲一遍,只看不练难以体会程序执行模型。
  3. 第 3 章数据结构部分建议配合纸笔画出内存与链表结构,理解效率差异。
  4. 配书视频与源码可在华章公司网站本书页面下载,建议按小节跟学。

About the publisher

China Machine Press China · Founded in 1950

In addition to science and technology and professional publishing, the books in our catalog from China Machine Press also reflect a sustained focus on psychology, computing, management, finance and economics, and social sciences. In psychology, the catalog includes works by C. G. Jung and introductions to analytical psychology, as well as applied topics such as stress and health, and addiction and healing. In computing, it features Structure and Interpretation of Computer Programs (JavaScript Edition). Management and finance titles include Administrative Behavior (4th Edition), The Price of Inequality (Collector's Edition), and This Time Is Different: Eight Centuries of Financial Folly (Commemorative Edition). In the philosophy and history of science, there is The Worldview: The Third Edition. Relevant authors include C. G. Jung, William McGuire, Sonu Shamdasani, and Gabor Maté. Public information is limited; the above summarizes the publisher's profile based solely on the books in our catalog.

Contents

  1. Chapter 1 Basics
  2. 1.1 History
  3. 1.2 Expressions (Operands, Operators, Nesting, Side Effects)
  4. 1.3 Running Programs (Interactive Execution Mode, Help Documentation, Scripts, Identifiers and Keywords, Error Messages, Euclid's Algorithm)
  5. 1.4 Built-in Types, Assignment, and References (Literals, Constructors, Container Types, Indexing and Slicing, the del Operation)
  6. 1.5 Control Flow Structures (if, Boolean Operations, while, for, Conditional Expressions, Defining Simple Functions)
  7. 1.6 Input/Output (Standard I/O Streams, Redirection, Pipes, Command-Line Arguments, Environment Variables, Formatted Strings)
  8. 1.7 Simple Exercises (Printing a Pyramid, the 3X+1 Problem, Drawing Regular Polygons, Drawing Function Curves, the Monte Carlo Method, Aitken Iteration)
  9. 1.8 Program Execution Model (Stateless Programs, Stateful Programs, Linear Memory, Designing Programs with Stacks/Queues)
  10. 1.9 Describing Algorithm Performance
  11. 1.10 Exception Handling
  12. 1.11 Program Debugging
  13. Chapter 2 Functions
  14. 2.1 Function Basics (Definition and Calls, Lambda Expressions, Callback Functions, Closures, Parameter Passing, Docstrings)
  15. 2.2 Modules and Packages
  16. 2.3 Scope and Stack Frames
  17. 2.4 Recursion (Single and Multiple Recursion, the Koch Snowflake, Post-order Traversal of Binary Trees, Eliminating Tail Recursion, Dynamic Programming, Wildcard Matching)
  18. 2.5 Classes and Instance Methods
  19. 2.6 Higher-Order Functions (Function Decorators, map and filter)
  20. 2.7 Iterator and Generator Patterns (Generator Functions, List Comprehensions and Generator Expressions)
  21. Chapter 3 Data Structures
  22. 3.1 Lists (Memory and Structure, Insertion, Sorting, Binary Search, Basic Operation Interfaces)
  23. 3.2 Linked Lists (Singly Linked Lists, the Iterator Pattern, Implementing Stacks and Queues with Linked Lists, Doubly Circular Linked Lists)
  24. 3.3 Hash Tables (Basic Principles, Application Examples, Dictionaries)
  25. 3.4 Binary Trees (Representation and Storage, Traversal, Binary Search Trees, Binary Heaps and Priority Queues, Huffman Coding)
  26. 3.5 Case Studies (deque Linked-List Blocks, OrderedDict)
  27. 3.6 Comprehensive Exercise: Pathfinding Algorithms (Graph Representation, Dijkstra's Algorithm, the A* Algorithm)
  28. Chapter 4 Object Orientation
  29. 4.1 Classes (Instance Methods, Static Methods, Class Attributes and Class Methods, Private Members, the property Decorator, Dynamically Adding Attributes and __slots__, Instance Lifecycles, Copying Objects)
  30. 4.2 Inheritance and Polymorphism (Syntax, How to Design Classes, Multiple Inheritance, Duck Typing and Polymorphism)
  31. 4.3 Comprehensive Exercise: GUI Programming with PyQt (Installing PyQt, Creating Windows with Inheritance, Responding to Events)
  32. References

FAQ

这本书适合完全零基础的读者吗?
书中定位是“有教师指导的初学者”,不讲解 Python 安装与编辑器配置。完全没有基础的读者需要先自行安装 Python 3、跑通一两个小程序,再进入本书第 1 章,否则容易在开头受挫。
书里配套的视频和源码怎么获取?
按书中说明登录华章公司网站,搜索本书书名进入图书页面,即可找到教学视频、示例源码与教学 PPT 的下载链接。不同印次说明可能略有差异,以书内前言与版权页指引为准。
需要什么基础数学知识才能读?
主要用到中学数学水平,如坐标与函数图像、简单的概率与迭代思想(蒙特卡洛方法、埃特金迭代)。算法复杂度部分只要求理解增长量级的直观含义,不需要专门的数学训练。
本书与常见的 Python 入门书有什么区别?
本书不追求覆盖面,而是深入讲程序设计核心方法:引用与赋值、程序执行模型、递归与消除递归、用内建类型剖析数据结构、面向对象设计。章节之间的知识是层层递进的,读完对“程序为什么这样运行”的理解会比语法型入门书更深。
本书使用的是 Python 哪个版本?
全书以 Python 3 为平台编写,内容涉及 Python 3 的相关特性。Python 3 后续小版本对书中基础语法影响不大,但个别标准库行为可能变化,遇差异建议查官方文档。

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

张頔 Author

Zhang Di is an author about whom limited public information is available; only one social science work is known, Industrial Chain Resilience: A Statistical Measurement Based on China's Manufacturing Industry. As the title suggests, the book focuses on industrial economics and statistical methods, taking China's manufacturing sector as its object of study and measuring the resilience of industrial chains. A topic of this kind generally requires both a theoretical framework and data support, so the writing is likely to emphasize conceptual definition, indicator construction, and empirical analysis in a rigorous and practical style. The work is intended for readers in economic research, industrial policy, and statistical practice, and is a specialized study in a focused field. Since details of the author's life, education, and positions are not available in public sources, the full picture of the author's work remains to be disclosed, but this book already shows an attention to the intersection of industrial chains and statistical measurement.

More by the same author

Top rated in the same category