Think Python: How to Think Like a Computer Scientist
300 pages
English
PDF
4.5

Think Python: How to Think Like a Computer Scientist

Think Python: How to Think Like a Computer Scientist

Author:

Year:

Summary:

Introduction

The book «Think Python: How to Think Like a Computer Scientist» by Allen Downey is one of the most popular Python textbooks for absolute beginners. Published in 2015 (second edition), it has already become a classic among self-study guides. The title reflects the main idea: to teach not just syntax, but the very mindset of a programmer — the ability to break down tasks into subtasks, abstract, and build algorithms.

The book is freely available online (under a Creative Commons license), which has made it especially popular in the community. On the PythonLib website, we recommend it as a starting point for those who want to enter the world of Python without fear or prejudice.

What the book is about

The book consists of 20 chapters that sequentially guide the reader from the very basics to fairly complex topics such as recursion, object-oriented programming, and data structures. Each chapter contains theoretical material, code examples, and exercises for reinforcement.

Main sections:

  • Chapters 1–3: Variables, expressions, data types, functions, and interfaces. The author immediately instills proper code style.
  • Chapters 4–6: Conditional statements, iterations, strings, and lists. This lays the foundation for working with data.
  • Chapters 7–10: Dictionaries, tuples, sets, and file handling. The reader learns to efficiently store and process information.
  • Chapters 11–14: Recursion, classes and objects, inheritance. The transition to OOP is an important stage for any programmer.
  • Chapters 15–20: Additional topics: debugging, testing, sorting and search algorithms, as well as a brief introduction to GUI.

A special feature of the book is its emphasis on practice. Almost every section ends with exercises that require writing code, not just reading theory.

Who this book is for

The book is aimed at beginners — those who have never programmed or have minimal experience. Allen Downey assumes the reader is familiar with basic mathematics (algebra, logic) and knows how to use a computer, but nothing more.

It will also be useful for:

  • students in technical fields who want to quickly learn Python for academic projects;
  • self-learners who prefer a structured approach;
  • teachers looking for a quality textbook for an «Introduction to Programming» course.

If you already know another programming language (Java, C++), the book may feel too slow — in that case, it's better to choose «Python Crash Course» or «Automate the Boring Stuff with Python».

What the reader will learn

After reading the book, you will be able to:

  • Write clean and understandable Python code, following PEP 8 recommendations.
  • Use basic data structures: lists, dictionaries, tuples, sets.
  • Create your own functions and classes, understand OOP principles.
  • Work with files and handle exceptions.
  • Apply recursion to solve problems (e.g., tree traversal).
  • Perform basic debugging and code testing.
  • Understand sorting algorithms (bubble sort, quicksort) and search algorithms (linear, binary).
  • Read and analyze other people's code.

Important: the book does not prepare you for web development or Data Science — it is a foundation upon which you can build further learning.

Strengths

1. Accessibility of presentation. Allen Downey writes in simple language, avoiding excessive academicism. Each concept is explained with real-life examples.

2. Focus on thinking. The book teaches not just syntax, but an approach to problem-solving. This sets it apart from many reference guides.

3. Exercises. They are selected to reinforce the material and develop

Recommendations