Think Python: How to Think Like a Computer Scientist is an introduction to programming with Python, written for beginning programmers. The author, Allen B. Downey, has very generously given permission for anyone to produce and distribute variations of it (see below for full license information). This page provides the Python 3 version of the text, prepared by Michael Kart and enriched with some hypertext features by myself.
The author’s original text, which is also available as a published book by O’Reilly, can be found here in html and PDF form:
Read the book: Think Python, Python 3 version
The PDF document is formatted for printing, but includes “bookmarks” that jump to each chapter and section. (Check that your PDF viewer shows the document’s “bookmarks” or “table of contents” in the side bar.) There are also hyperlinks from the table of contents (which starts on page xi) to the respective sections.
Why distribute another version?
The examples in the book are based on python 2. Differences from python 3 (the modern version of the language) are small, and discussed in the text; but it is better to avoid needless confusion altogether. The book’s website links to a Python 3 version of the text in PDF form, prepared by Michael Kart. However, it has two shortcomings:
- It is not available in HTML format, but only as a PDF document.
- The PDF document is suitable for printing, but lacks bookmarks or hyperlinks for navigation of the electronic document.
Hence, I generated enriched PDF and HTML versions of Michael Kart’s text (from the source he provides), adding hypertext features to the PDF and fixing a pet peeve in the html version: The chapters in the table of contents are now numbered. Since I have made no changes to the text itself (except for updating the syntax of a few more print statements), I have not changed his version number or claimed any sort of authorship of the result.
Allen B. Downey, the author of Think Python, provides the following license statement on the book’s website:
“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.”