Python Crash Course, 3rd Edition cover

Python Crash Course, 3rd Edition

Rating 4.6
Word count
416K words
Chapters
30
Series
Turing Programming Series · Python
ISBN
9787115613639

Tags

Summary

This is an introductory textbook for Python readers at all levels, known among readers as the "Python snake book." It consists of two parts: basics and project practice. Part One (Chapters 1–11) begins with setting up the Python and VS Code development environment, then systematically covers variables and simple data types, lists and working with lists, if statements, dictionaries, user input and while loops, functions, classes, files and exceptions, and finally introduces code testing with pytest, helping readers build complete basic syntax and programming habits. Part Two (Chapters 12–20) applies that knowledge to three complete projects: Project 1 builds the 2D game Alien Invasion with Pygame, across three chapters on the armed ship, aliens, and scoring; Project 2 covers data visualization, in turn generating data, downloading data, and using APIs; Project 3 builds a Django web application, covering getting started, user accounts, and styling and deployment. The third edition is fully revised for Python 3.11: it switches to the VS Code text editor, adds coverage of the removeprefix() and removesuffix() methods, uses the latest features of Matplotlib and Plotly in the projects, and includes five appendices on installation troubleshooting, text editors and IDEs, getting help, Git version control, and deployment troubleshooting. The book emphasizes "writing code by hand," with exercises in every chapter, and suits self-study from scratch.

Editor's review

如果想用一本书把 Python 从零学到能做出东西,这本书是长期被验证的选择。它的结构特别“诚实”:前十章不炫技,只把变量、列表、字典、函数、类、文件与异常这些地基一块块夯实,并反复强调写整洁代码、用 pytest 做测试——这些习惯比语法本身更值钱。真正的分水岭在第二部分,三个项目难度递进:先做能看见飞船动起来的 Pygame 小游戏,再转向用 Matplotlib、Plotly 处理真实数据的可视化,最后用 Django 做出能注册登录、能上线部署的网站。每个项目都把前面章节的零散知识串成完整工程,做完之后读者会第一次有“我能独立做一个东西”的底气。第3版以 Python 3.11 重写,工具换成 VS Code,删掉了过时写法,同时配套随书代码、课件与速查资料,自学时不容易卡在环境配置上。需要提醒的是,它教的是入门与工程实践,不是深度语法参考,读完仍需按方向继续深入。

Who it's for

A good fit for

  • 完全没有编程基础、想系统自学 Python 的成年人
  • 准备转行或补充编程技能的职场人士
  • 想把 Python 教给学生的中小学信息课老师
  • 需要一门配套教材的大学程序设计入门课程学生
  • 有一点其他语言基础、想快速上手 Python 项目的程序员

Not a good fit for

  • 想直接学机器学习、深度学习算法的读者,本书不涉及模型原理
  • 已有多年 Python 经验、寻找语言底层与性能进阶内容的人
  • 只想要语法速查手册、不愿动手敲代码的读者

Reading tips

  1. 务必亲手敲完书中代码并完成每章练习,只看不练等于没读
  2. 第一部分按顺序读,第9章“类”是难点,可放慢速度并回头复习
  3. 三个项目至少完整做完一个,做完后尝试自己加功能,如给游戏加音效
  4. 遇到环境或版本报错先查附录A与附录E,再对照随书代码排查

About the publisher

Posts & Telecom Press China · Founded in 1953

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. Part I: Basics
  2. Chapter 1: Getting Started
  3. Chapter 2: Variables and Simple Data Types
  4. Chapter 3: Introducing Lists
  5. Chapter 4: Working with Lists
  6. Chapter 5: if Statements
  7. Chapter 6: Dictionaries
  8. Chapter 7: User Input and while Loops
  9. Chapter 8: Functions
  10. Chapter 9: Classes
  11. Chapter 10: Files and Exceptions
  12. Chapter 11: Testing Your Code
  13. Part II: Projects
  14. Project 1: Alien Invasion
  15. Chapter 12: A Ship That Fires Bullets
  16. Chapter 13: Aliens
  17. Chapter 14: Scoring
  18. Project 2: Data Visualization
  19. Chapter 15: Generating Data
  20. Chapter 16: Downloading Data
  21. Chapter 17: Working with APIs
  22. Project 3: Web Applications
  23. Chapter 18: Getting Started with Django
  24. Chapter 19: User Accounts
  25. Chapter 20: Styling and Deploying an App
  26. Appendix A: Installation and Troubleshooting
  27. Appendix B: Text Editors and IDEs
  28. Appendix C: Getting Help
  29. Appendix D: Using Git for Version Control
  30. Appendix E: Deployment Troubleshooting

FAQ

这本书需要先学别的编程语言吗?
不需要。本书从安装 Python、运行第一个 hello_world.py 开始讲起,默认读者零基础,前几章会带着读者认识变量、循环和函数等最基本的概念。
第3版和第2版的主要区别是什么?
第3版代码基于 Python 3.11 升级,开发工具由旧编辑器改为 VS Code,新增 removeprefix() 与 removesuffix() 方法讲解,项目中使用 Matplotlib 和 Plotly 的最新特性,并更新了 Django 相关章节。
书里的三个项目分别用哪些库?
项目1《外星人入侵》用 Pygame 开发 2D 游戏;项目2 数据可视化使用 Matplotlib 与 Plotly,并涉及数据下载与 API 调用;项目3 使用 Django 框架搭建 Web 应用并部署。
这本书可以用来准备考试或作为课程教材吗?
可以。全书章节结构清晰、每章配有练习,国内有高校将其列为程序设计入门参考书或教材,适合按章节安排教学进度使用。
读完这本书之后应该读什么?
可按方向选择:数据分析可读《利用Python进行数据分析》,Web 方向继续深入 Django 官方文档,语言进阶可读《流畅的Python》。本书提供的是基础与工程实践,进阶需另找专著。

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.

More by the same author

Top rated in the same category