This book actually started out life as a Java programming guide, before being subsequently translated into Python. The overall aim is the same, regardless of language – to get the reader to think like a computer scientist (which incidentally was the book’s original title). Downey uses Python as a tool to teach wider programming concepts, rather than simply teaching the use of Python itself.
The book starts out with an explanation of what a program is, covering structure, and going on to cover basic elements such as variables, expressions and functions. These concepts are described at a high level, with examples given in Python but easily understood so that the concept as a whole could be applied in other programming languages.
Chapter 4 provides the book’s first case study, and moves the reader on from disparate ideas to an illustration of how the concepts explained in the first three chapters can fit together to form a program. For the purposes of Think Python, Downey has created a package called Swampy, available from the book’s companion website. Installation instructions are contained on the website rather than in the book – a clever move to avoid obsolescence in the book, given the numerous and changing systems Python is available for.
A welcome introduction at this point is a program which results in graphical output. So many programming books spend several chapters giving only console output that beginner programmers can feel a sense of not achieving very much. By displaying graphics at this early stage of the book, Downey allows the novice programmer to have some visual reward near to the start of the learning process.
Think Python continues at a steady pace, generally introducing one or two new programming concepts in each chapter – the pace is ideally suited to teaching an introductory programming course, perhaps not a surprise when considering the book’s origins as material for the course which Downey taught. Elements such as conditionals, iteration and string handling are taught, always with examples using Python but with a clear explanation of what the element does and not just a set of instructions to copy and paste into Python.
Towards the end of the book, more advanced subjects such as files, classes and objects are introduced through a couple more case studies. Downey is careful not to overwhelm the reader with these more difficult concepts, and spreads the idea of classes over three chapters to ensure a thorough understanding. The final chapter introduces the Tkinter module for producing GUIs, and brings together all of the programming concepts used throughout.
Each chapter ends with a set of exercises for the reader to test their knowledge, solutions to which are hosted on the aforementioned companion website – again, assisting with the book’s suitability for course teaching.
Overall, Think Python is a well written book which achieves the author’s aim of teaching the concept of programming, using the Python language as a learning aid rather than detailing the specifics of the language itself. I would recommend it for anyone looking for an introductory programming text, or a text on which to base an introductory programming course.
Think Python is published by O’Reilly Media