Chapter Topics#
The chapters progress from Python fundamentals, control flow, functions, and testing to core data structures and text processing, then to program design with objects, functional tools, iterators, and APIs, and finally to abstract data structures and algorithms. Preview, Lab, and Homework activities accompany each chapter.
Chapter |
Topics |
|---|---|
Natural and formal languages; levels of abstraction; interpreted and compiled languages; expressions and statements; number systems and character encoding; indentation and statement formatting; input, output, and f-strings; built-in functions, modules, and packages. |
|
Variables and naming conventions; objects, types, identity, and mutability; aliasing; assignment, arithmetic, and comparison operators; truthiness, membership, and identity; logical and bitwise operators; type checking, conversion, and hinting; strings and collection types. |
|
|
|
Defining functions and encapsulation; parameters, default values, |
|
Types of errors and tracebacks; |
|
Creating and accessing lists; list comprehensions and nested lists; list operators, functions, and methods; |
|
Creating dictionaries; accessing, updating, and deleting items; membership testing; dictionary comprehensions; counting with |
|
Escape sequences, indexing, and slicing; string methods for searching, cleaning, splitting, and formatting; comparing and sorting strings; regular expressions with the |
|
Classes and instances; methods, |
|
Pure functions and immutability; functions as values; higher-order functions; decorators; comprehensions and choosing a style; recursion versus iteration; context managers; |
|
The iterator protocol; built-in lazy iterators; custom iterator classes; generator functions; generator expressions; infinite sequences and |
|
Reading an API contract; GET requests with |
|
Abstract types and implementations; operation tradeoffs; stacks; queues; trees; graphs and graph traversal. |
|
Properties of algorithms; the design process; complexity and Big O; benchmarking; linear and binary search; the |
Each part also has an overview page: Part I, Part II, Part III, and Part IV.
Set up your environment with Course Tooling and Jupyter Setup in the appendices before the first lab.