Skip to content

Chapters

This textbook is organized into 20 chapters covering 400 concepts for the AP Computer Science (Python Version) course.

Chapter Overview

  1. Introduction to Computer Science - Foundational concepts including computational thinking, hardware basics, binary numbers, and programming languages.
  2. Python Fundamentals - Core Python basics from variables and data types through arithmetic operators, input/output, and expressions.
  3. Boolean Logic and Comparisons - Boolean expressions, comparison and logical operators, short-circuit evaluation, and truth tables.
  4. Control Flow - Conditional statements, for and while loops, break/continue, and common iteration patterns.
  5. Working with Strings - String indexing, slicing, methods, formatting, iteration, and text manipulation.
  6. Functions and Modular Design - Function definition, parameters, return values, variable scope, and docstrings.
  7. Higher-Order Functions and Recursion - Lambda functions, map/filter/reduce, recursive thinking, base cases, and call stacks.
  8. Lists - List creation, indexing, slicing, mutability, methods, comprehensions, and traversal.
  9. Advanced List Operations - List copying, sorting, min/max/sum, lists as stacks/queues, aliasing, and identity vs equality.
  10. Tuples and Sets - Tuple immutability, packing/unpacking, set operations, membership testing, and frozensets.
  11. Dictionaries - Dictionary creation, methods, iteration, comprehensions, and common patterns like counting and grouping.
  12. Classes and Objects - Class definition, instantiation, attributes, constructors, methods, and encapsulation.
  13. Inheritance and Polymorphism - Inheritance hierarchies, method overriding, polymorphism, operator overloading, and UML diagrams.
  14. Errors and Exceptions - Exception types, try-except blocks, raising and custom exceptions, and assertions.
  15. File Input and Output - Reading/writing files, context managers, file paths, CSV and JSON file handling.
  16. Software Engineering Practices - Modules, packages, version control, PEP 8 style, refactoring, and documentation.
  17. Testing and Debugging - Unit testing, test cases, debugging strategies, breakpoints, and defensive programming.
  18. Searching and Sorting - Linear/binary search, selection/insertion/merge sort, Big-O notation, and complexity basics.
  19. Algorithm Analysis and Problem Solving - Complexity classes, divide and conquer, greedy algorithms, memoization, and algorithmic patterns.
  20. Advanced Python Features - Generators, decorators, type hints, dataclasses, and standard library modules.

How to Use This Textbook

Chapters are designed to be read in order, as each chapter builds on concepts from previous ones. The learning graph ensures that all prerequisite concepts are covered before they are needed. If you are already familiar with certain topics, you can skip ahead, but be sure to review the concept list in each chapter to confirm you have the prerequisite knowledge.