Think Python

2nd Edition

by Allen B. Downey

翻译 大胖哥

This is a very classical book for newbies of programing. There are some versions of translation. But I still think that we can do it by ourselves.


This is the second edition of Think Python. It uses Python 3, with notes on differences in Python 2. If you are using Python 2, you might want to use the first edition.

这是Think Python这本书的第二版,本次使用的是Python3,与Python2有很多不同,这些不同之处会有标注。如果你用Python2的货,还是建议你去阅读上一个版本

Buy the first edition at


Download Think Python 2e in PDF.

下载 Think Python 2e PDF格式的电子版.

Read Think Python 2e in HTML.

在线阅读 Think Python 2e HTML网页版本(推荐这个,都是文字格式,更方便).

Example programs and solutions to some problems are here (links to specific examples are in the book).


Description 说明

Think Python is an introduction to Python programming for beginners.

Think Python 这本书是面向初学者介绍Python编程。

It starts with basic concepts of programming, and is carefully designed to define all terms when they are first used and to develop each new concept in a logical progression.


Larger pieces, like recursion and object-oriented programming are divided into a sequence of smaller steps and introduced over the course of several chapters.


What's new in the second edition?


  • We've upgraded to Python 3: All examples in the book are now Python 3, and the supporting code has been updated to run in both Python 2 and 3.


  • We've removed the roadblocks: Based on reader feedback, we know where people had problems, so we've fixed or removed the pain points.


  • Python in the browser: For beginners, one of the challenges of getting started is installing Python. For readers who don't want to install Python right away, we provide instructions for running Python in a browser using PythonAnywhere, a free online programming environment.


  • More Python goodies: We've added a chapter to cover some powerful Python features that didn't make it into the first edition, including list comprehensions and additional data structures.


Think Python 2e is a Free Book.


It is available under the Creative Commons Attribution-NonCommercial 3.0 Unported License, which means that you are free to copy, distribute, and modify it, as long as you attribute the work and don't use it for commercial purposes.


If you have comments, corrections or suggestions, please send me email at feedback{at}thinkpython{dot}com.


Other Free Books by Allen Downey are available from Green Tea Press.

其他由 Allen Downey 编写的自-和谐-由书籍都可以在Green Tea Press找到.

Download 下载

  • Precompiled copies of the book are available in PDF.


LaTeX代码在GitHub这里可以下载:this GitHub repository.

  • Here is the HTML version, and here is the HTML code in a zip archive.

网页在线阅读 HTML version, 这些网页打包下载 HTML code ,这是一个zip格式的压缩包。

Earlier Versions


The first edition is here.


A previous edition of this book was published by Cambridge University press with the title Python for Software Design. This edition is available from

本书的上一个版本是由剑桥大学出版社出版的,标题是 Python for Software Design. 可以到亚马逊去买到哈。

The original Python version of the book was published by Green Tea Press with the title How to Think Like a Computer Scientist: Learning with Python. This edition is available from from

本书的原始版本由Green Tea Press 出版,标题为 How to Think Like a Computer Scientist: Learning with Python. 这个版本可以从这个网站找到

Other Free Books by Allen Downey are available from Green Tea Press.

其他由 Allen Downey 编写的自-和谐-由书籍都可以在Green Tea Press找到.

powered by Gitbook 该教程制作时间: 2016-03-25 13:29:01