If you want to learn how to program, working with Python is an excellent way to start. This hands-on guide takes you through the language a step at a time, beginning with basic programming concepts before moving on to functions, recursion, data structures, and object-oriented design. This second edition and its supporting code have been updated for Python 3.
If you want to learn how to program, working with Python is an excellent way to start. This hands-on guide takes you through the language a step at a time, beginning with basic programming concepts before moving on to functions, recursion, data structures, and object-oriented design. This second edition and its supporting code have been updated for Python 3.
Through exercises in each chapter, youâ??ll try out programming concepts as you learn them. Think Python is ideal for students at the high school or college level, as well as self-learners, home-schooled students, and professionals who need to learn programming basics. Beginners just getting their feet wet will learn how to start with Python in a browser.
作者简介
· · · · · ·
Allen Downey is a Professor Emeritus at Olin College and Principal Data Scientist at PyMC Labs. He is the author of several books related to programming and data science, including Probably Overthinking It, Think Python, Think Stats, and Think Bayes. The idea behind these books is that if you know how to program, you can use that skill to learn other things.
Allen Downey is a Professor Emeritus at Olin College and Principal Data Scientist at PyMC Labs. He is the author of several books related to programming and data science, including Probably Overthinking It, Think Python, Think Stats, and Think Bayes. The idea behind these books is that if you know how to program, you can use that skill to learn other things.
Allen has a Ph.D. from U.C. Berkeley and M.S. and B.S. degrees from MIT. He has taught at Olin College, Colby College and Wellesley College.
目录
· · · · · ·
Preface
1. The Way of the Program
2. Variables, Expressions and Statements
3. Functions
4. Case Study: Interface Design
5. Conditionals and Recursion
· · · · · ·
(更多)
Preface
1. The Way of the Program
2. Variables, Expressions and Statements
3. Functions
4. Case Study: Interface Design
5. Conditionals and Recursion
6. Fruitful Functions
7. Iteration
8. Strings
10. Lists
11. Dictionaries
12. Tuples
13. Case Study: Data Structure Selection
14. Files
15. Classes and Objects
16. Classes and Functions
17. Classes and Methods
18. Inheritance
19. The Goodies
20. Debugging
21. Analysis of Algorithms
Index
· · · · · · (收起)
For some people, programming and debugging are the same thing. That is, programming is the process of gradually debugging a program until it does what you want. The idea is that you should start with a program that does something and make small modifications, debugging them as you go, so that you always have a working program.
For example, Linux is an operating system that contains thousands of lines of code, but it started out as a simple program Linus Torvalds used to explore the Intel 80386 chip. According to Larry Greenfield, “One of Linus’s earlier projects was a program that would switch between printing (查看原文)
The final version of the function doesn`t display anything when it runs;it only returns a value.The print statements we wrote are useful for debugging,but once you get the function working,you should remove them.Code like that is called scaffolding because it is helpful for building the program but is not part of the final product.
When you start out,you should add only a line or two of code at a time.As you gain more experience,you might find yourself writing and debugging bigger chunks.Either way,incremental development can save you a lot of debugging time.
The key aspects of the process are:
1.Start with a working program and make small incremental changes.At any porint,if there is an error,you should have a good idea where it is.
2.Use temporary variables to hold intermediate values ... (查看原文)
对于一个自学程序设计的入门者而言,他需要一本什么样的书呢?我认为标准有以下三个: 第一,介绍足够用的知识。这一点看似简单,但是却不易掌握,像许多人推荐的 A Byte of Python,内容就明显过少了,而处于另一个极端的 Learning Python 篇幅超过一千页,又明显超出入门者...
(展开)
其官网上如是说: 最开始(2002年),以”How to Think Like a Computer Scientist: Learning with Python“的名称在Green Tea Press出版。2008年重印了一次。 http://book.douban.com/subject/1481058/ 后来(2009年),以”Python for Software Design: How to Think Like a...
(展开)
这本书是我在来来回回的地铁上看完的,很紧凑,很短小,很易读。这本书是很好的Python入门书籍,也是很好的编程与计算思想入门的书籍,而作者的编排也是遵循渐进的,并且偶然提出的问题(如在讲解string与操作符提出的“Can you think of a property that addition has that str...
(展开)
1 有用 BlaCk 2017-10-02 08:32:01
跟作者聊过这本书和他写过的其他书。。。
0 有用 Mr. No 2022-02-22 16:16:33
热诚
2 有用 林二熱 2023-11-11 13:10:28 澳大利亚
讲函数那一章提到了函数带 return 语句和不带的区别。不是说 return 会终止函数,而是说为什么要 return 语句, 当时对新手的我来说,有不少启发。这书还有个免费的 OCaml 版,就叫 Think OCaml
1 有用 五十梦幻 2017-07-06 18:41:05
一本 Python 入门的书。我看此书的主要目的是用来提高自己的英语阅读水平。
7 有用 y 2016-07-21 23:31:15
很简单,很短…… 这本书是免费的,可以在 http://greenteapress.com/wp/think-python-2e/ 获取