Think Python: How to Think Like a Computer Scientist - 2e
Allen B. Downey, Franklin W. Olin College of Engineering
Copyright Year: 2012
ISBN 13: 9781491939369
Publisher: Green Tea Press
Conditions of Use
This book is well structured and outlined to introduce each topic as it builds on the previous. The reader is presented with clear examples related to mathematics and is presented with techniques for building programs. Each chapter gives the... read more
This book is well structured and outlined to introduce each topic as it builds on the previous. The reader is presented with clear examples related to mathematics and is presented with techniques for building programs. Each chapter gives the readers the tools to test supporting examples and exercises to strengthen their programming abilities. It is easy to read, straight forward, and provides the reader with straightforward plans for program development and design patterns. While most of the topics are covered in many classes already, this book feels like a refresher more than a lesson on topics like algorithms, lists, classes, etc. The examples on most of the topics are great if you already know this material. I think this book should not be an intro to computer science coursebook. While many for me, I can understand the message and understand the author's information, but I believe this would not work for someone who has only taken the first course in computer science. The simple examples would not be enough for people to grasp what they need unless they supplement this book with many examples outside of the book.
Most of these examples and topics are great because they are quick and to the point! While I have some experience with python, I learned many small things you can do that make your life easier, like methods within strings. This brings up the book's point of feeling like form someone who already knows some of the computer science material. The topics are very well put together for that target audience. Each chapter allows the reader to test their understanding with clear cut examples commonly taught in many programming courses. For instance, they are using recursion for the mathematical function of the Fibonacci sequence. The reader can test each example and have the opportunity to experiment with the exercises provided after every chapter. To provide a bit of accuracy in content, each section includes a glossary section to review key terms and consists of a debugging section that informs the reader of potential errors, pitfalls, or useful techniques used to help with problem-solving.
In the literature, the author indicates that thinking like a scientist, more specifically, a computer scientist, “combines some of the best features of mathematics, engineering, and natural science.” This book allows the reader to develop problem-solving skills to think creatively about solutions and enable the reader to express them through programming exercises. Python is currently one of the most popular programming languages, easy to learn and understand, and is a marketable skill for today’s developers. It is used in a variety of industries and is widely used throughout the world. I did not like the Turtle example towards the start of the book “Turtle Word” I felt this was not relevant to the import example. I felt the math import did a great job explaining why you need to import modules and how easy they can be to use. By using Turtle world, I felt like it was more work to describe something that is supposed to be simple. This was the only instance where I thought it was more confusing than helpful.
The book clarity was great! I liked the conditional statements part of the book since I felt the examples covered everything. Even when an example was missing a condition, if the number was to be a negative number when looking for positive integers, or if the number was zero, I think the author should think of a great way of explaining these core concepts and how they are used in python. The content is concise and straight to the point, but the first-time programmers may find themselves going back to previous chapters to understand the content in later topics. The author wrote to keep the reader on a clear track to support previous sections. The literature builds gradually to difficult issues, but someone who does not know any programming concepts may struggle for a time before becoming acclimated to its context. The book also assumes that the reader has a strong mathematical foundation. This may result in students who are weak in mathematics struggling to understand programming concepts.
From start to finish, the work is written using very simple language for any reader. The reader has an opportunity to test their knowledge and competency of each topic, but assumes the reader has previous experiences with programming syntax. There is only a small area that discusses syntax, which may create difficulty for first-time programmers. This book has a text-focused approach to programming, and gives the reader examples to understand without using a computer, and provides a clear break down for every step. Experienced programmers may find themselves skipping sections, while first-time programmers may go back and forth to understand previous concepts. The examples remained relevant and straightforward to everyday things you will typically find in the real world. I felt the same level of difficulty in functions than on classes and explaining inheritance. I also really enjoyed the author's tips during more challenging topics and all the debugging. The book feels complete because of this. The book was adapted from a Java book, making this teaching style seem to be very modular. As far as the teaching style on the topics covered, I felt this was well represented to start looking into python as their main programming language. The author went above and beyond with the topic on tkinter. I appreciate it being so flexible to teach not only the core but some UI, in case the reader would like to try and do small projects for themselves.
The arrangement of each chapter is divided into subsections that outline various features of computer programming procedural language. This book layers each section of fundamental programming features with how the Python language uses these features through exercises, solutions, and discussions. The text builds on each section giving the reader a clear example and improving each new topic. This book seems to be missing answers for the exercises at the end of each chapter, and it doesn't have an opportunity to test the reader's code.
As mentioned before, the organization was well placed and felt like a complete course on getting your hands-on experience on python. The examples were fun to see and use to know why certain things do not work with python syntax. This is a book and not an online interactive program; I feel the interface was excellent since there was not much distracting information over people’s heads. An example would be a graph that might be unnecessary, as the future prediction of how many programmers will be using python over the next ten years. The book was very centered, which made it easy to read on multiple devices. There is a defined structure for building on previous programming concepts and provides a section for debugging potential errors the reader will encounter. It allows the reader to test examples and use the textbook as a reference if an issue arises. This is not the same for the end of chapter exercises. Some can be extremely difficult and often use techniques not yet discussed in the current section. This may leave the reader to find resources or solutions elsewhere.
This book uses dynamic fonts to differentiate a program example from text explaining the current section for ease of reading. The PDF version uses outlined links to different sections of the text and makes it easy to jump to other text areas. This book also provides usable hyperlinks to external online resources. Each chapter offers figures displaying stack diagrams specific to programs to refer to the state of variables in an object, so readers clearly understand the processes.
The grammar in this text is simple to read and straight to the point. Each concept is explained using simple language to allow the reader to feel comfortable learning a programming language. Each chapter has a glossary for the reader to refresh themselves with critical terms they may not understand. Still, it may have readers searching for additional resources to understand concepts not explicitly described. Readers who are not familiar with mathematical concepts may have difficulty understanding what a program is doing if they struggle with mathematical language. The vocabulary used was also something easy to understand. This made the book feel very welcoming to a large group of people. This book could be simple for someone whose English was not their first language. The sentences were very fluid, and felt like I was being taught directly by the author.
Python has been widely adopted across many different industries and has become one of today's leading programming languages. Python is easy to learn, and first-time programmers will easily understand examples in this book. This book is an excellent tool for new and seasoned programmers looking to learn a new programming language. Python has a massive community base and support for developers to find solutions to various problems.
This book is an excellent resource for beginners and those who want to learn a new programming language. The literature is clear, concise, and effective in providing clear examples for readers to follow along. Those who struggle with mathematics may have issues understanding examples and may have questions outside of the scope of programming. The book does an excellent job of structuring each programming concept and building on each to allow the reader to understand how to develop and design a program.
The book was easy to get a quick understand of it's focus and areas. Table of Content and index are well built. End of each chapter has glossary review, very useful. read more
The book was easy to get a quick understand of it's focus and areas. Table of Content and index are well built. End of each chapter has glossary review, very useful.
The book is accurate and the author has made considerable effort in fixing noted issues pointed out by users.
The book uses python 2x, python has moved to 3x. End of life for python2 was January 1 2020. Most of the content is still relevant and portable to python 3x
Language, code and narrative, was clear to read and understand.
I've found the terminology and framework used in this book consistent.
Chapters are subdivided with appropriate headings making it easy to read and follow/reference.
The topics in the text are presented in a logical, clear fashion.
Text was easy to navigate, interface is user friendly.
Have not found any grammatical errors.
Not Applicable; the topic is cultural neutral. However, in the context of 'programming' culture, in my view and opinion, it does follow the common traits of disseminating knowledge for the positive influence of making humanity better, to solve problems ethically, morally and the most sacred promiss not to do harm.
For those who are in python2x/2.7 environment is book is a very good reference. To use in a python 3x, the reader/user would have to review python2 to python3 changes: https://docs.python.org/3/howto/pyporting.html
The book covers the structures and components of the Python programming language thoroughly and effectively. It is appropriate for use as a textbook for an Introductory course for computer science with Python programming. read more
The book covers the structures and components of the Python programming language thoroughly and effectively. It is appropriate for use as a textbook for an Introductory course for computer science with Python programming.
Contents are accurate.
Yes, the contents is up to date. This book covers the Python 3, while many other books of similar kind available online only cover Python 2 which has been replaced by the newer version Python 3 since 2008.
The book is easy to read and understand.
The book uses standard and formal terminology and framework in the subject area.
The book is well structured in accordance with the common ways of teaching/learning a programming language in computer science.
Yes, like most of the similar programming language books.
The book makes use of lots of code examples which is a good feature and helps a lot for student to learn the Python language and the programming.
Did not see any obvious grammatical error.
Did not find anything that is culturally inappropriate.
I got this book through an online resource before getting into this library site, and have used some contents of this book, along with other books available to me, to prepare my course material for the Introduction to Python.
This book provides a nice overview all necessary materials required to understand Python like a real programmer. More importantly, the book aims to encourage to learn Python conceptually instead of just learning the syntax of a certain programming... read more
This book provides a nice overview all necessary materials required to understand Python like a real programmer. More importantly, the book aims to encourage to learn Python conceptually instead of just learning the syntax of a certain programming language.
The contents of this book are error-free, accurate, and unbiased.
The main concern of this book is Python 2. The author may need to consider to shift the materials to Python 3. In that line, more programming exercises may be added to the current version.
The technical materials of the book has been discussed in a clear and comprehensive fashion.
The style of all chapters are consistent and comprehensive.
The modularity of the book is excellent. In fact, one can easily follow the chapters without trouble.
The organization of this book is quite strong.
The text is well-formatted and easy to navigate.
I found no grammatical errors or typos in the text.
The overall structure of this book is very user-friendly and attainable.
I enjoyed to read the book and I believe can be considered as very first step to learn programming language in a very structured way.
This book covers a wide range of techniques that are necessary to understand programming in Python. The book starts with introducing fundamental backgrounds of programming languages how they have evolved. Since Python is a type of interpreter... read more
This book covers a wide range of techniques that are necessary to understand programming in Python. The book starts with introducing fundamental backgrounds of programming languages how they have evolved. Since Python is a type of interpreter language, some instructions could miss telling how a high-level language is translated into a machine language. However, this book presents a comparison of the executions between interpreter and compiler languages. Also, this book addresses useful libraries in Chapter 9, 10 which can be used to instruct young learners by inspiring visible programming libraries. The last a few chapter of this book covers some high level concepts of programming languages such as objects, inheritance, classes, and algorithm libraries- linked lists, stacks, queues, and trees. One bonus point of this book is that this can be used for not only introductory programming courses but also a reference book for advanced computer science courses.
The content of this book is very accurate and unbiased. When introducing the programming skills, the authors tried to explain that programming always has multiple ways to achieve the designed goal.
This book quite relevant to the area of computer science. However, there is still vague how students become a thinker like a computer scientist.
The text uses appropriate terms and vocabularies understood by academies as well as industry practices. Also, the book consists of 20 major chapters and many sub-chapters which help learners clearly understand this book content.
The structure of this book keeps solid consistency throughout the entire chapters. Each chapter begins with a short and concise description then shows examples and expected outcomes. Then, at the end of each chapter has glossary section which extremely helps understand this book.
This book wonderfully grouped the content by similar concepts. The molecularity of this book, mainly constructed by chapters, increases the usefulness of this book in classrooms.
Overall, the flow and structure of this book looks very smooth. Also, the logical order of chapters were well organized to be introduced this book to beginners sequentially.
The interface of this book needs some improvements. However, given GNU license which is copy-free license, the artistic disadvantages of this book is negligible.
There is no issues in grammars
Since this book is a technical guide book, there is no need to consider cultural aspects. However, this book kindly addresses the complex programming concepts which enable under-resourced students to start learn computing skills.
This book is one of greatest books in the world of Python languages. I applaud the authors' effort to build this copy-free book that can be accessed free for the students who cannot afford expensive textbooks. Though the book is open and free, it contains all the important programming skills and examples.
The text covers all areas and ideas of Python comprehensively and thoroughly. The first few chapters introduce basic concepts needed to understand programming in general. Basic Python programming concepts are also introduced in the first few... read more
The text covers all areas and ideas of Python comprehensively and thoroughly. The first few chapters introduce basic concepts needed to understand programming in general. Basic Python programming concepts are also introduced in the first few chapters. The book progresses smoothly introducing more complex programming concepts as the reader progresses through the text. Each chapter builds upon the previous chapter providing a deeper understanding of Python programming as the book progresses. The index and glossary provide a clear path to key concepts within the text.
Topics are presented clearly. The text is error-free and no bias is evident throughout the book.
The topics within each chapter are arranged comprehensively and in a modular manner easily allowing additions and updates to the content as needed depending on Python version upgrades.
The text is written very clearly and concisely. Terminology is explained within the chapter and again in the glossary provided at the end of each chapter. Ample examples are used within the chapter to clarify concepts. Concepts within the chapter are reinforced through exercises provided at the end of each chapter which encourage the reader to practice with Python.
The text is consistent in terms of terminology and framework. Terminology is presented, explained and reviewed throughout the chapter and at the end of each chapter in the glossary provided. The framework is consistent throughout the text. Within each chapter, the topic is first introduced and then expanded upon. The topics in the chapter are reinforced through examples and again through the exercises provided at the end of the chapter.
The text is modular. Topics within a chapter are divided into logical units which are easily read and comprehended. Each unit is succinctly labeled and logically organized within the chapter and also within the book.
Topics are introduced in a logical and well organized manner. The text begins with basic topics which are then expanded. The earlier chapters help build the foundation for the later chapters. Within each chapter topics are organized in a logical order. The basics are explained in the beginning of the chapter and are then expanded upon throughout the chapter.
It is easy to navigate through the text. There are no distractions and no display features which distract or confuse the reader.
The book contains no grammatical errors. The book is well written. It is clear and concise.
Does not apply
The book covers the breadth and width of programming in Python. It is well written and organized. It follows a logical order beginning with the basic concepts and building on these concepts as the reader moves through the chapters. The topics are clearly explained and reinforced by the use of ample examples within the chapters and exercises at the end of each chapter. Terminology is reinforced through the use of a glossary at the end of each chapter. The book provides the reader with a thorough understanding of Python. It assumes the reader has no prior experience of Python. By the end of the book, the reader will be well versed in programming concepts and specifically with Python as a programming language.
Python is a great language for beginners to learn the basics of computer programming. This book covers most of the primary Python syntax. It would make a good reference book to supplement existing lectures, without being too unwieldy. For a... read more
Python is a great language for beginners to learn the basics of computer programming. This book covers most of the primary Python syntax. It would make a good reference book to supplement existing lectures, without being too unwieldy. For a beginner textbook, I would need to add more explanation of basics and how to think through programming.
Content is accurate, although could use more updates for the new version of Python. It was a little confusing in places where explanations switch between Python 2 and Python 3.
I believe this work will remain relevant for as long as the current version of Python is in use. General concepts will not change, but the book will need to be updated with newer versions of code snippets.
The writing is clear and concise with few errors. Some lessons will need further explanation from instructor if using this book.
The book is written in a consistent and personable style.
Programming is a difficult topic to teach to beginners. This book did a fairly good job of breaking it down into manageable chunks without overwhelming the reader.
Although I would have organized the topics in a different order (some difficult topics are presented very early), I believe the book’s flow meets the author’s goals.
I did not experience any difficulties with the interface.
I did not identify grammatical errors.
I don’t believe this category applies to this topic. Having said that, the book was not culturally insensitive or offensive in any way.
Python is becoming increasingly important in its use for scientific and engineering applications. This text is an easy-to-read short volume on the use of Python for coding, that teaches the reader generic skills of good programming. The topics... read more
Python is becoming increasingly important in its use for scientific and engineering applications. This text is an easy-to-read short volume on the use of Python for coding, that teaches the reader generic skills of good programming. The topics covered are comprehensive and sequentially coherent, especially for a novice in programming. Perhaps the biggest strength of this book is the fluidity of the topics and the ease of communication in the chapters. There are very useful examples and exercises present in every chapter that progressively walks the reader through the aspects of coding (in Python). There are links with solutions in the book for the reader's benefit as well. This reviewer would have liked an introductory section that describes a step by step installation and use of an editor for Python; however, given the wide choices and the changing environment of editors, this is a minor concern that pales in comparison to the myriad benefits provided by this book.
As far as this reviewer is concerned, the contents of this book are accurate and free of glaring errors.
Since the author has taken the approach of educating the reader on how to think and program like a computer scientist rather than provide a crash course or a recipe-type approach to programming in Python, this book may not become obsolete in the near future. However, as version of Python change their syntax every now and then, the onus might be on the reader to keep abreast of such quirks while reading this book.
As mentioned before, the biggest strength of this book is the fluidity of the topics and the ease of communication in the chapters. There are very useful examples and exercises present in every chapter that progressively walks the reader through the aspects of coding (in Python). There are links with solutions in the book for the reader's benefit as well.
This text is quite consistent in its contents, terminology, framework, and flow of material.
The topics of this book are so arranged in sequential order that it might benefit the novice reader to go thru the book from first to last. However, this may not be true for the slightly advanced reader that may benefit from the modularity of the topic. This reviewer was able to go back and forth between these topics arranged in chapters. The arrangement of the sections within the chapters are also well thought and presented with increasing complexity.
The structure and flow of the book are presented in an organized manner.
The book has working links for solutions, examples, and other resources that are free of issues.
This reviewer could not discern any grammatical errors in this book.
The text is not culturally insensitive or offensive in any way.
The text concisely but thoroughly covers the basics of programming in the Python language, from expressions and functions to file processing and object-oriented programming. The HTML version of the text has an index, but the DF version lacks... read more
<p> The text concisely but thoroughly covers the basics of programming in the Python language, from expressions and functions to file processing and object-oriented programming. The HTML version of the text has an index, but the DF version lacks it, for some reason. Each chapter features a glossary of relevant terms and topics. Chapters are named in such a way that it is easy to glean topics. I was especially pleased to see a chapter on graphic user interfaces and the Tkinter library. Each chapter also includes several coding or thought exercises for the student, and solutions for all of them are provided as URLs and links. Throughout, special attention is given to principles and techniques in program debugging, and the general prevention of syntactic and semantic errors. This is a short book, so it does not go into every final detail of the language. Its purpose is rather to teach fundamental programming concepts using Python, and does so very effectively.</p>
<p> I have not spotted any factual inaccuracies or biases in the text. However, see below for some discussion on the particular versions of Python covered.</p>
<p> The book's subject matter is mostly timeless, in that as long as procedural and object-oriented programming are taught, the content is relevant. A minor concern is that the book concentrates on Python 2, a slightly older version of the language. (At the time of this review, Python is at version 3.4.1.) The author does point out the few places where there is a difference in coding between Python 2 and Python 3, for tasks such as printing and integer division. On the book's web page is a link to a version of the text that is "converted" to Python 3, written by a third party. Those already familiar with Python are probably aware of the protracted transition between Python 2 and 3 in industry and academia. My own preference is that teaching materials cover Python 3 exclusively, to prevent confusion and potentially outmoded coding styles.</p>
<p> The prose is direct and to the point, with surprising clarity. New and potentially difficult concepts are expressed clearly, and when technical terminology is used, it is explicitly defined.</p>
<p> The text is very consistent in its overall style for each chapter, and the book overall feels like a coherent unit.</p>
<p> The book is divided into 19 chapters and three appendices. Chapters are about 10-15 pages long, and appendices are about 5 pages long each. The brevity of the text and the many subheadings for each chapter enables a good degree of modularity. Once in a while, certain concepts are "sprung early" in one chapter, but explained more thoroughly in subsequent chapters. For example, opening and reading from text files was introduced briefly in Chapter 9 to enable the analysis of string/text data, but file manipulation itself was more formally covered later, as Chapter 14. I did not find this practice disruptive. While chapters generally built on one another, I felt that many chapters could stand alone or be reordered as needed.</p>
<p> The text had good organization of topics. Chapters are short, so relatively specific topics such as "Strings", "Files", and "Inheritance" are at the focus of each. Since the chapters are only 10-15 pages long, small portions of subject matter can be more easily read and understood. There was also a good flow of topics from simple to complex, where ideas introduced in one chapter are revisited or built upon in subsequent chapters.</p>
<p> I mainly focused on the PDF version of the text, which was free of errors. Links and URLs were enabled in the PDF, making navigation and lookup simple. My only complaint is that exercises, which are interspersed in the text, are not always set off by white space from any preceding material. As such, narrative sometimes runs into exercises. The flow can still be followed, but it is an odd error.</p>
<p> The text contained no grammatical errors that I was aware of. Based on material in the Preface, the text has been scrutinized by many people over time, and readers are credited with spotting errors and contributing new material.</p>
<p> I found no material that was insensitive or offensive from the standpoint of culture, gender, etc. Some examples and exercises involve the manipulation of text in languages other than English, which is a nice feature, as it shows that some concepts, such as string handling or dictionaries, transcend language. Since the text focuses mainly on Python 2, which does not natively support Unicode strings, there is no discussion of non-Roman languages. In true Python fashion, there are occasional references to Monty Python jokes, including strings such as "spam" and "eggs". While this is harmless in itself, I sometimes worry that as time passes, fewer and fewer students will be familiar with Monty Python, or understand the cultural references.</p>
<p> I was motivated to review this book because I teach a course on basic Python programming to health sciences students. Overall, the book reads best as a brief but comprehensive introduction to computer science principles, with Python as the exemplar language. Some students may not have the background or interests to understand or apply some of the topics covered in the book (e.g., algorithmic complexity or operator overloading), and as such, this text may work best as a short book for science and engineering students. However, I found it to be an unexpectedly readable and usable text, and I plan to try it in a future iteration of my Python course.</p>
Table of Contents
- 1 The way of the program
- 2 Variables, expressions and statements
- 3 Functions
- 4 Case study: interface design
- 5 Conditionals and recursion
- 6 Fruitful functions
- 7 Iteration
- 8 Strings
- 9 Case study: word play
- 10 Lists
- 11 Dictionaries
- 12 Tuples
- 13 Case study: data structure selection
- 14 Files
- 15 Classes and objects
- 16 Classes and functions
- 17 Classes and methods
- 18 Inheritance
- 19 The Goodies
- A Debugging
- B Analysis of Algorithms
About the Book
Think Python is a concise introduction to software design using the Python programming language. Intended for people with no programming experience, this book starts with the most basic concepts and gradually adds new material. Some of the ideas students find most challenging, like recursion and object-oriented programming, are divided into a sequence of smaller steps and introduced over the course of several chapters.
This textbook has been used in classes at Bard College, Olin College of Engineering, University of California, Santa Barbara, University of Maine, University of Northern Colorado.
About the Contributors
Allen B. Downey is an American computer scientist, professor of computer science at the Franklin W. Olin College of Engineering and writer of free textbooks.
Downey received in 1989 his BS and in 1990 his MA, both in Civil Engineering from the Massachusetts Institute of Technology, and his PhD in Computer Science from the University of California at Berkeley in 1997.
He started his career as Research Fellow in the San Diego Supercomputer Center in 1995. In 1997 he became Assistant Professor of Computer Science at Colby College, and in 2000 at Wellesley College. He was Research Fellow at Boston University in 2002 and Professor of Computer Science at the Franklin W. Olin College of Engineering since 2003. In 2009-2010 he was also Visiting Scientist at Google Inc.