Learn Python 3 the Hard Way cover

Learn Python 3 the Hard Way

Rating 3.9
Word count
382 words
Chapters
40
ISBN
9787115478818

Tags

Summary

This book is the Python 3 edition of the Learn Python the Hard Way series, an introductory tutorial originally titled Learn Python 3 the Hard Way. It is based on Python 3.6 and, apart from "Exercise 0: The Setup," contains 52 exercises. The first 26 cover three major themes—input/output, variables, and functions—while the second 26 move into more advanced topics such as conditionals, loops, classes and objects, code testing, and project implementation. The structure is highly consistent: each exercise first presents a code listing and explanation; readers must type the code in character by character (the author explicitly opposes copy-paste), run it and check the output, then complete additional exercises and read the frequently asked questions. The author advocates "the hard way"—repeated hands-on practice, making mistakes actively, and debugging on one's own—so as to truly understand how computers work, what makes a good program, and how to read code, write code, and trace code in one's head. The training path starts with printing "Hello World" and gradually advances to reading and writing files, functions, dictionaries, modules, object-oriented programming, and automated testing, ending with a small web-based game project. The book also includes about five hours of accompanying instructional videos (accessed by scanning a code) that demonstrate how to deliberately break code, locate errors, and debug and fix them. The language is plain and the demands are strict; many chapters require readers to persist through repetitive exercises, so it is called a "self-disciplined" introductory book: suitable for those with zero background but willing to invest time to build solid fundamentals, and not for readers seeking quick results or wanting to jump straight into advanced frameworks.

Editor's review

这是一本“反教程”的入门书:不铺垫概念,不带你逛语法目录,而是把 52 个精心设计的习题摆在你面前,让你一行一行手敲、跑起来、看着它报错,再自己修好。Zed A. Shaw 的核心主张很简单——编程是肌肉记忆,读一百遍不如亲手错一遍。 它的价值在于路径完整且陡峭有序:前 26 题把输入输出、变量、函数练到熟,后 26 题顺势进入条件、循环、类与对象、自动化测试,最后落到一个 Web 小游戏项目,让初学者第一次完整经历“写码—调试—成项目”的闭环。书中配套约五小时视频,作者当着你的面把代码改坏再修好,这种“现场拆解”对新手极有说服力。 它也有鲜明的门槛:重复练习量大,作者语气直接甚至强硬,对不愿动手的读者不友好;内容基于 Python 3.6,部分工具链细节已显旧,需自行对照新版环境。但正因如此,它特别适合想要一次性把编程基本功打牢、并且愿意严格照做的人。对零基础自学 Python 来说,它是少见的高强度、可执行、可验收的路线图。

Who it's for

A good fit for

  • 零基础、从未写过代码但想系统入门 Python 的读者
  • 愿意每天固定投入时间、能坚持完成重复练习的自学者
  • 计算机专业低年级学生,用来补齐动手编码和调试能力
  • 转行求职者,希望通过完整项目实践建立编程信心
  • 偏好“先动手再理解”学习方式、不喜欢大段理论讲述的人

Not a good fit for

  • 希望快速上手数据分析、爬虫或框架开发而不想练基本功的读者
  • 只想读不想敲代码、缺乏自律的读者
  • 已有扎实 Python 基础、想深入算法或工程架构的进阶者

Reading tips

  1. 务必逐字手敲代码,不要复制粘贴,并故意改坏几处观察报错信息
  2. 每完成一个习题先独立做附加练习,再对照书中的常见问题解答
  3. 把 52 个习题拆成每日 1–2 个的节奏,坚持四周左右完成一轮
  4. 阅读时用 Python 3.6 以上的现行版本运行示例,注意环境与书中的差异

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. Exercise 0: The Setup (macOS / Windows / Linux / Online Search / A Warning for Beginners)
  2. Exercise 1: A Good First Program
  3. Exercise 2: Comments and Pound Characters
  4. Exercise 3: Numbers and Math
  5. Exercise 4: Variables and Names
  6. Exercise 5: More Variables and Printing
  7. Exercise 6: Strings and Text
  8. Exercise 7: More Printing
  9. Exercise 8: Printing, Printing
  10. Exercise 9: Printing, Printing, Printing
  11. Exercise 10: What Was That?
  12. Exercise 11: Asking Questions
  13. Exercise 12: Prompting People
  14. Exercise 13: Parameters, Unpacking, Variables
  15. Exercise 14: Prompting and Passing
  16. Exercise 15: Reading Files
  17. Exercise 16: Reading and Writing Files
  18. Exercise 17: More Files
  19. Exercise 18: Names, Variables, Code, Functions
  20. Exercise 19: Functions and Variables
  21. Exercise 20: Functions and Files
  22. Exercise 21: Functions Can Return Something
  23. Exercise 22: What You Have Learned So Far
  24. Exercise 23: Read Some Code
  25. Exercise 24: More Practice
  26. Exercise 25: Even More Practice
  27. Exercise 26: Congratulations, Take a Test!
  28. Exercise 27: Memorizing Logic
  29. Exercise 28: Boolean Practice
  30. Exercise 29: What If
  31. Exercise 30: Else and If
  32. Exercise 31: Making Decisions
  33. Exercise 32: Loops and Lists
  34. Exercise 33: While Loops
  35. Exercise 34: Accessing Elements of Lists
  36. Exercise 35: Branches and Functions
  37. Exercise 36: Designing and Debugging
  38. Exercise 37: Symbol Review
  39. Exercise 38: Doing Things to Lists
  40. Exercise 39: Dictionaries, Oh Lovely Dictionaries

FAQ

这本书适合完全没有编程基础的人吗?
适合。作者写作时的明确目标读者就是对计算机了解不多、没学过编程但感兴趣的人,全书从打印语句开始,逐步推进到完整项目,不预设任何编程知识。
书中的代码需要最新版 Python 吗?
本书基于 Python 3.6 编写,示例本身在更新的 Python 3.x 版本上大多可以运行,但安装步骤、部分库的行为可能随版本变化,遇到差异时可查阅对应版本的官方文档。
为什么强调不要复制粘贴代码?
作者认为手敲代码能让初学者对每个字符、缩进和标点保持敏感,并在输入错误、报错、排错的过程中建立真正的编程直觉,这是全书“笨办法”理念的核心。
书中是否包含配套视频?
有。中文版提供约五小时的配套教学视频,通过扫码在线观看,内容主要演示如何改坏代码、定位错误并调试修复。
52 个习题大概需要多久学完?
取决于投入时间。若每天完成 1–2 个习题,大约四周可以刷完一轮;但附加练习和复习往往需要额外时间,建议以掌握为准而不是赶进度。

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