Think Python

How to Think Like a Computer Scientist

by Allen B. Downey

Buy this book at Amazon.com

Download Think Python in PDF.

Read Think Python in 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. 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.

Some examples and exercises are based on Swampy, a Python package written by the author to demonstrate aspects of software design, and to give readers a chance to experiment with simple graphics and animation.

Think Python 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.

Download

Python 3.0

Most of the book works for Python 2.x and 3.0. Where there are differences, they are pointed out in footnotes.

Michael Kart at St. Edward's University has adapted the book for Python 3.0. You can download his version in PDF or get his source code in a zip file. Thanks, Michael!

Earlier Versions

The 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.

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.

Translations and adaptations

Sat Kumar Tomer has written a related book, Python in Hydrology available here.

Nicholas Monje has translated the book into OCaml. His version is at thinkocaml.com.

Jeff Elkner, who was my co-author on How to Think, is working on a second edition, available here.

The book Apprendre a programmer avec Python by Gerard Swinnen started as a French translation of How to Think..., but has evolved into a substantially different book.

Ricardo Perez has translated How to Think... into Spanish and adapted it for the Eiffel programming language. His translation is available here.


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

Consider making a donation toward my web hosting bill.

Like this book?

Are you using one of our books in a class?

Please consider filling out this short survey.