Learn Python the Hard Way (3rd Edition) cover

Learn Python the Hard Way (3rd Edition)

Rating 3.9
Word count
373K words
Chapters
40
ISBN
9787115350541

Tags

Summary

Learn Python the Hard Way (3rd Edition) is the Chinese edition of Zed A. Shaw's Learn Python the Hard Way, a Python primer for readers with no prior programming experience. The book does not organize itself around theory; instead it builds the learning path from 52 carefully designed exercises. The first 26 cover the basics—printing, input, variables, math, strings, and functions—while the remaining 26 move on to conditionals, loops, lists, dictionaries, modules, classes and objects, inheritance and composition, automated testing, handling user input, and simple websites and web games. Each exercise follows roughly the same format: the code and instructions are given, the reader types the code in character by character (copy-pasting is forbidden), runs the program and checks the output against the expected result, then completes the extra credit and reads the frequently asked questions. Through repeated typing, making mistakes, and debugging, the author wants beginners to understand how programs actually work, what good code looks like, and how to locate and fix errors the way a programmer does. The book ends with "The Next Steps," "Advice from an Old Programmer," and a command-line crash course, so readers can go further once they have the basics.

Editor's review

市面上的Python入门书大多先讲概念、再配例子,而这本书走的是相反的路:先把代码敲出来,让程序跑起来,在错误和调试里理解原理。“禁止复制粘贴”这条古怪要求,恰恰是它最有效的地方——你无法跳过打字,也就无法跳过思考。52个习题从打印一句话开始,一路走到函数、类、自动化测试,最后做出一个简易的Web游戏,读者会在不知不觉中完成一次完整的软件开发体验。作者Zed Shaw语言直白、带点调侃,能把枯燥的语法讲得不让人犯困,适合那些看书容易走神、只想“赶紧动手写点东西”的初学者。作为异步图书引进的经典入门读物,本版依据Python 3编写,配套光盘中另有作者的教学视频。需要提醒的是,本书出版于2014年,示例环境以当时的Python 3版本为准,读者在较新的环境中练习时可能需要对少量写法略作调整。

Who it's for

A good fit for

  • 完全没有编程经验、想从零开始学Python的读者
  • 看书容易犯困、更愿意通过动手练习学习的人
  • 需要一门结构化课程来督促自己坚持练习的自学者
  • 准备转行或补充编程基础的非计算机专业学生

Not a good fit for

  • 已有一定Python基础、想系统学习进阶特性的开发者
  • 希望系统了解Python语言规范与原理的读者
  • 想直接学习数据分析、机器学习等应用方向的人

Reading tips

  1. 提前配好Python 3环境,按书中习题顺序推进,不要跳着做。
  2. 严格遵守“禁止复制粘贴”的要求,逐字敲代码并观察每次运行结果。
  3. 遇到报错先自己排查,再对照书中的常见问题回答,养成调试习惯。
  4. 每完成一个阶段的习题,回头重做一次附加练习,巩固函数、循环与类等概念。

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. Copyright Information
  2. Copyright Notice
  3. Summary
  4. Translator's Preface
  5. Preface
  6. Exercise 0: The Setup
  7. Exercise 1: A Good First Program
  8. Exercise 2: Comments and Pound Characters
  9. Exercise 3: Numbers and Math
  10. Exercise 4: Variables and Names
  11. Exercise 5: More Variables and Printing
  12. Exercise 6: Strings and Text
  13. Exercise 7: More Printing
  14. Exercise 8: Printing, Printing
  15. Exercise 9: Printing, Printing, Printing
  16. Exercise 10: What Was That?
  17. Exercise 11: Asking Questions
  18. Exercise 12: Prompting People
  19. Exercise 13: Parameters, Unpacking, Variables
  20. Exercise 14: Prompting and Passing
  21. Exercise 15: Reading Files
  22. Exercise 16: Reading and Writing Files
  23. Exercise 17: More Files
  24. Exercise 18: Names, Variables, Code, Functions
  25. Exercise 19: Functions and Variables
  26. Exercise 20: Functions and Files
  27. Exercise 21: Functions Can Return Something
  28. Exercise 22: What You Learned So Far
  29. Exercise 23: Read Some Code
  30. Exercise 24: More Practice
  31. Exercise 25: Even More Practice
  32. Exercise 26: Congratulations, Take a Test!
  33. Exercise 27: Memorizing Logic
  34. Exercise 28: Boolean Practice
  35. Exercise 29: What If
  36. Exercise 30: Else and If
  37. Exercise 31: Making Decisions
  38. Exercise 32: Loops and Lists
  39. Exercise 33: While Loops
  40. Exercise 34: Accessing Elements of Lists

FAQ

这本书适合零基础读者吗?
适合。全书面向对计算机了解不多、没学过编程但感兴趣的读者,从第一个打印程序讲起,用52个习题逐步带出变量、函数、类与项目开发等内容。
第3版和后来的新版有什么区别?
第3版出版于2014年,依据Python 3编写,并附有作者的教学视频光盘。后续版本在新版Python基础上更新了练习与示例,读者若使用较新的环境,个别写法可能需要微调。
一定要严格手敲代码、不能复制吗?
作者明确要求手敲并禁止复制粘贴。手指输入的过程能让你看清每个字符、符号的作用,遇到错误时也更容易定位问题,这正是本书学习方法的核心。
学完这本书能达到什么水平?
能掌握Python基本语法、函数、数据结构、类与对象以及简单的测试和Web开发流程,具备继续自学框架或应用方向的基础,但距离独立开发完整项目仍需额外练习。

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.

Top rated in the same category