# 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](http://www.greenteapress.com/thinkpython/index.html).
> 這是Think Python這本書的第二版,本次使用的是Python3,與Python2有很多不同,這些不同之處會有標注。如果你用Python2的貨,還是建議你去閱讀[上一個版本](http://www.greenteapress.com/thinkpython/index.html)。
Buy the first edition at [Amazon.com ](http://amzn.to/Owtmjy)
> 到[亞馬遜](http://amzn.to/Owtmjy)購買本書
Download Think Python 2e in [PDF](http://www.greenteapress.com/thinkpython2/thinkpython2.pdf).
> 下載 Think Python 2e [PDF格式的電子版.](http://www.greenteapress.com/thinkpython2/thinkpython2.pdf)
Read Think Python 2e in [HTML](http://www.greenteapress.com/thinkpython2/html/index.html).
> 在線閱讀 Think Python 2e [HTML網頁版本](http://www.greenteapress.com/thinkpython2/html/index.html)(推薦這個,都是文字格式,更方便).
Example programs and solutions to some problems are [here](http://www.greenteapress.com/thinkpython2/code) (links to specific examples are in the book).
> 樣例代碼以及其他問題的解決可以到[這里](http://www.greenteapress.com/thinkpython2/code)找(具體樣例的鏈接在書中就有)。
## 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.
> 開始用Python3了:書里面所有樣例都用Python3來實現,參考代碼也都做了升級,用Python2或者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.
> 瀏覽器內能Python編程了:初學者遇到的第一個困難就是安裝Python。另外有的讀者可能不想去直接就安裝Python,我們就提供了一個用瀏覽器來運行Python的簡介:使用PythonAnywhere,一個免費的在線Python編程環境。(譯者注:中國用戶以考慮試試fenby.com,也有類似的實現,還有視頻的介紹。)
* 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.
> 更多Python彩蛋:單獨加了一章,來介紹一些第一版中沒有提及的Python功能,比如列表解析和附加的數據結構。
Think Python 2e is a Free Book.
> 這本書是一本自-和諧-由的書。
It is available under the [Creative Commons Attribution-NonCommercial 3.0 Unported License](http://creativecommons.org/licenses/by-nc/3.0/), 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.
> 本書遵循[創作共用署名-非商業性使用-第三版協議](http://creativecommons.org/licenses/by-nc/3.0/),這意味著你可以自-和諧-由地復制、分發和修改他,只要你有所貢獻,并且不用于商業目的,就可以。
If you have comments, corrections or suggestions, please send me email at feedback{at}thinkpython{dot}com.
> 如果你有一些評論、修正或者建議,可以發郵件給feedback@thinkpython.com
Other Free Books by Allen Downey are available from [Green Tea Press](http://greenteapress.com/).
> 其他由 Allen Downey 編寫的自-和諧-由書籍都可以在[Green Tea Press](http://greenteapress.com/)找到.
## Download 下載
* Precompiled copies of the book are available in [PDF](http://www.greenteapress.com/thinkpython2/thinkpython2.pdf).
> 編譯好的PDF版本在這里下載:[PDF](http://www.greenteapress.com/thinkpython2/thinkpython2.pdf)。
* The LaTeX source code is available from [this GitHub repository](https://github.com/AllenDowney/ThinkPython2).
> LaTeX代碼在GitHub這里可以下載:[this GitHub repository](https://github.com/AllenDowney/ThinkPython2).
* 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](http://www.greenteapress.com/thinkpython).
> 第一版在[這里](http://www.greenteapress.com/thinkpython)
A previous edition of this book was published by Cambridge University press with the title Python for Software Design. This edition is available from Amazon.com.
> 本書的上一個版本是由劍橋大學出版社出版的,標題是 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 Lulu.com.
> 本書的原始版本由Green Tea Press 出版,標題為 How to Think Like a Computer Scientist: Learning with Python. 這個版本可以從這個網站找到 Lulu.com.
Other Free Books by Allen Downey are available from Green Tea Press.
> 其他由 Allen Downey 編寫的自-和諧-由書籍都可以在Green Tea Press找到.
- 介紹
- Think Python
- Chapter 0 Preface 前言
- Chapter 1 The way of the program 編程之路
- Chapter 2 Variables, expressions and statements 變量,表達式,語句
- Chapter 3 Functions 函數
- Chapter 4 Case study: interface design 案例學習:交互設計
- Chapter 5 Conditionals and recursion 條件循環
- Chapter 6 Fruitful functions 有返回值的函數
- Chapter 7 Iteration 迭代
- Chapter 8 Strings 字符串
- Chapter 9 Case study: word play 案例學習:單詞游戲
- Chapter 10 Lists 列表
- Chapter 11 Dictionaries 字典
- Chapter 12 Tuples 元組
- Chapter 13 Case study: data structure selection 案例學習:數據結構的選擇
- Chapter 14 Files 文件
- Chapter 15 Classes and objects 類和對象
- Chapter 16 Classes and functions 類和函數
- Chapter 17 Classes and methods 類和方法
- Chapter 18 Inheritance 繼承
- Chapter 19 The Goodies 額外補充