Appendix E: Glossary
All key terms introduced across the 27 chapters of this textbook, alphabetized. The chapter number in parentheses indicates where the term is first defined. "See also" entries point to related terms.
Abstract base class (ABC) (Ch. 15, §15.4): A class that cannot be instantiated directly and defines one or more abstract methods that subclasses must implement. Created in Python using the abc module. See also: abstract method, inheritance, polymorphism.
Abstract data type (ADT) (Ch. 20, §20.1): A theoretical description of a data structure defined by its operations (what it does) rather than its implementation (how it does it). Stacks, queues, and dictionaries are ADTs. See also: stack, queue, encapsulation.
Abstract method (Ch. 15, §15.4): A method declared in an abstract base class that has no implementation. Subclasses must override it. Decorated with @abstractmethod. See also: abstract base class, method overriding.
Abstraction (Ch. 1, §1.2): One of the four pillars of computational thinking. The process of hiding unnecessary details behind a simpler interface. Functions, classes, and modules are all forms of abstraction. See also: computational thinking, encapsulation, function.
Accumulator pattern (Ch. 5, §5.4): A loop pattern that builds up a result incrementally: initialize a variable (the accumulator) before the loop, update it inside the loop, use it after the loop. See also: loop, iteration.
Agile (Ch. 26, §26.3): A software development methodology emphasizing iterative development, flexibility, collaboration, and frequent delivery of working software. See also: Scrum, sprint, Waterfall.
Algorithm (Ch. 1, §1.2): A finite, precise sequence of well-defined steps for solving a problem or performing a computation. See also: computational thinking, Big-O notation, pseudocode.
Algorithm analysis (Ch. 17, §17.2): The process of determining the efficiency of an algorithm in terms of time and space as the input grows. See also: Big-O notation, time complexity, space complexity.
Aliasing (Ch. 8, §8.7): When two or more variable names refer to the same mutable object in memory. Changes through one name are visible through the other. See also: mutable, shallow copy, deep copy.
Anchor example (Ch. 1, §1.5): A recurring scenario used throughout this textbook to ground concepts in realistic applications. The four anchor examples are: the Grade Calculator, Elena's Nonprofit Report, Crypts of Pythonia, and Dr. Patel's DNA Pipeline.
API (Application Programming Interface) (Ch. 21, §21.3): A set of rules and protocols that allows different software applications to communicate with each other. REST APIs use HTTP requests to exchange data, typically in JSON format. See also: REST, HTTP, JSON.
Append mode (Ch. 10, §10.2): A file opening mode ("a") that adds new content to the end of a file without erasing existing content. See also: write mode, read mode, context manager.
Argument (Ch. 6, §6.2): A value passed to a function when it is called. Distinguished from parameter, which is the variable name in the function definition. See also: parameter, keyword argument, default parameter.
Assert / Assertion (Ch. 13, §13.5): A statement (assert condition, message) that tests whether a condition is true and raises AssertionError if it is false. Used for internal sanity checks and testing. See also: unit test, debugging.
Assignment (Ch. 3, §3.1): The act of binding a name to a value using the = operator. Example: x = 42. See also: variable, augmented assignment.
Augmented assignment (Ch. 3, §3.5): A shorthand that combines an operation with assignment. Example: x += 5 is equivalent to x = x + 5. See also: assignment, operator.
Backlog (Ch. 26, §26.3): In Agile/Scrum, an ordered list of features, bug fixes, and tasks that need to be completed for a software project. See also: Agile, sprint, user story.
Base case (Ch. 18, §18.1): The condition in a recursive function that stops the recursion and returns a value directly without making another recursive call. See also: recursion, recursive case, stack overflow.
Beautiful Soup (bs4) (Ch. 24, §24.2): A Python library for parsing HTML and XML documents, commonly used for web scraping. See also: web scraping, HTML, CSS selector.
Big-O notation (Ch. 17, §17.2): A mathematical notation that describes the upper bound of an algorithm's growth rate as input size increases. Common classes: O(1), O(log n), O(n), O(n log n), O(n²), O(2ⁿ). See also: algorithm analysis, time complexity.
Binary search (Ch. 19, §19.2): A search algorithm that finds a target value in a sorted collection by repeatedly dividing the search interval in half. Time complexity: O(log n). See also: linear search, Big-O notation.
Boolean (Ch. 3, §3.3): A data type with exactly two values: True and False. Named after mathematician George Boole. See also: truthiness, comparison operator, Boolean operator.
Boolean operator (Ch. 4, §4.3): An operator that combines or modifies Boolean values: and, or, not. See also: Boolean, short-circuit evaluation, De Morgan's laws.
Branch (Ch. 25, §25.3): In Git, an independent line of development. Branches allow multiple features to be developed simultaneously without interfering with each other. See also: Git, merge, commit.
Break (Ch. 5, §5.6): A statement that immediately exits the innermost enclosing loop. See also: continue, loop.
Brute force (Ch. 17, §17.4): A problem-solving strategy that tries all possible solutions until the correct one is found. Simple but often inefficient. See also: algorithm, greedy algorithm, divide and conquer.
Bug (Ch. 1, §1.3): An error in a program. Named after a literal moth found in a Harvard Mark II computer in 1947. See also: debugging, syntax error, logic error, runtime error.
Call stack (Ch. 6, §6.5): The data structure Python uses to track active function calls. Each function call creates a new stack frame containing local variables and the return address. See also: stack frame, scope, recursion.
CI/CD (Continuous Integration / Continuous Deployment) (Ch. 26, §26.5): Automated processes that build, test, and deploy code whenever changes are committed. See also: version control, testing, Agile.
Class (Ch. 14, §14.1): A blueprint or template for creating objects. Defines the attributes (data) and methods (behavior) that all objects of that type will have. See also: object, instance, method, attribute.
Class attribute (Ch. 14, §14.4): An attribute defined directly in the class body, shared by all instances. Distinguished from instance attribute, which is unique to each object. See also: instance attribute, class.
Clone (Ch. 25, §25.5): In Git, creating a local copy of a remote repository. See also: Git, remote, fork.
Code coverage (Ch. 13, §13.4): The percentage of source code lines (or branches) that are executed during testing. Higher coverage generally means more thorough testing, but 100% coverage does not guarantee correctness. See also: unit test, testing.
Code review (Ch. 26, §26.4): The practice of having other developers examine your code for errors, style issues, and design problems before it's merged. See also: pull request, version control.
Code smell (Ch. 16, §16.3): A surface indication in the source code that usually corresponds to a deeper problem. Examples: very long functions, duplicated code, too many parameters. See also: refactoring, design pattern.
Cohesion (Ch. 16, §16.2): The degree to which the elements inside a module or class belong together. High cohesion (each unit does one well-defined job) is desirable. See also: coupling, Single Responsibility Principle.
Comment (Ch. 2, §2.5): A line or portion of a line beginning with # that Python ignores. Used for human-readable explanations. See also: docstring.
Commit (Ch. 25, §25.2): In Git, a snapshot of the project at a specific point in time. Each commit has a unique hash, an author, a timestamp, and a message describing the changes. See also: Git, staging area, branch.
Comparison operator (Ch. 3, §3.4): An operator that compares two values and returns a Boolean: ==, !=, <, >, <=, >=. See also: Boolean, expression.
Compiler (Ch. 2, §2.2): A program that translates an entire source program into machine code before execution. Distinguished from an interpreter, which executes code line by line. See also: interpreter.
Composition (Ch. 15, §15.5): A design relationship where one object contains another as an attribute ("has-a") rather than inheriting from it ("is-a"). Often preferred over inheritance for flexibility. See also: inheritance, "has-a", "is-a".
Computational thinking (Ch. 1, §1.2): A problem-solving approach based on four pillars: decomposition, pattern recognition, abstraction, and algorithm design. Applicable far beyond programming. See also: decomposition, pattern recognition, abstraction, algorithm.
Constructor (Ch. 14, §14.2): The __init__ method in a Python class, called automatically when a new object is created. Sets up the initial state of the object. See also: class, __init__, instance.
Context manager (Ch. 10, §10.1): An object that manages resources (like files) using the with statement, ensuring proper cleanup even if errors occur. See also: with statement, file object.
Continue (Ch. 5, §5.6): A statement that skips the rest of the current loop iteration and jumps to the next iteration. See also: break, loop.
Counter (Ch. 9, §9.6): A dictionary subclass from the collections module designed for counting hashable objects. See also: dictionary, defaultdict.
Coupling (Ch. 16, §16.2): The degree of interdependence between software modules. Low coupling (modules interact through narrow, well-defined interfaces) is desirable. See also: cohesion, encapsulation.
CSV (Comma-Separated Values) (Ch. 10, §10.5): A plain-text file format where each line is a data record and fields are separated by commas. See also: JSON, file I/O.
Custom exception (Ch. 11, §11.5): A user-defined exception class that inherits from Exception, allowing you to raise and catch domain-specific errors. See also: exception, raise.
Dataclass (Ch. 16, §16.4): A class decorator (@dataclass) from the dataclasses module that automatically generates __init__, __repr__, __eq__, and other special methods for classes primarily used to store data. See also: class, decorator.
Debugging (Ch. 13, §13.3): The process of finding and fixing bugs in a program. Strategies include print debugging, using a debugger, binary search for bugs, and rubber duck debugging. See also: bug, breakpoint, traceback.
Decorator (Ch. 16, §16.4): A function that modifies or extends the behavior of another function or class. Applied with the @ syntax. Examples: @property, @staticmethod, @dataclass, @abstractmethod. See also: property, dataclass.
Decomposition (Ch. 1, §1.2): One of the four pillars of computational thinking. Breaking a complex problem into smaller, manageable sub-problems. See also: computational thinking, abstraction, function.
Deep copy (Ch. 8, §8.7): A copy that recursively duplicates all nested objects, creating completely independent structures. Created with copy.deepcopy(). See also: shallow copy, aliasing, mutable.
Default parameter (Ch. 6, §6.3): A function parameter with a pre-assigned value that is used if the caller doesn't provide an argument. Example: def greet(name, greeting="Hello"). See also: parameter, keyword argument.
defaultdict (Ch. 9, §9.6): A dictionary subclass from collections that provides a default value for missing keys, avoiding KeyError. See also: dictionary, Counter.
Dependency (Ch. 23, §23.3): An external package or library that your project requires to run. Managed with pip and tracked in requirements.txt. See also: pip, virtual environment, package.
deque (Ch. 20, §20.3): A double-ended queue from the collections module that supports efficient append and pop operations from both ends. Used to implement queues. See also: queue, stack.
Design pattern (Ch. 16, §16.3): A general, reusable solution to a commonly occurring problem in software design. Examples: Strategy, Observer, Factory. See also: Strategy pattern, Observer pattern, Factory pattern.
Dictionary (Ch. 9, §9.1): A mutable, unordered collection of key-value pairs. Keys must be hashable (immutable). Average O(1) lookup time. See also: key, value, hash, dictionary comprehension.
Dictionary comprehension (Ch. 9, §9.4): A concise syntax for creating dictionaries: {k: v for k, v in iterable}. See also: dictionary, list comprehension.
Divide and conquer (Ch. 17, §17.4): An algorithm design strategy that breaks a problem into smaller subproblems, solves each recursively, and combines the results. Merge sort is a classic example. See also: recursion, merge sort, algorithm.
Docstring (Ch. 6, §6.7): A string literal placed as the first statement in a function, class, or module, used for documentation. Accessible via help() or .__doc__. See also: comment, function.
Dunder method (Ch. 14, §14.3): See special method.
EAFP (Easier to Ask Forgiveness than Permission) (Ch. 11, §11.4): A Python coding style that tries an operation first and handles exceptions if they occur, rather than checking conditions in advance. See also: LBYL, exception, try/except.
Edge case (Ch. 13, §13.2): An input or scenario at the extreme boundary of expected values, often revealing bugs. Examples: empty lists, zero, negative numbers, very long strings. See also: boundary condition, testing.
Encapsulation (Ch. 14, §14.5): The practice of bundling data and methods together in a class and restricting direct access to internal state. Python uses naming conventions (_private, __mangled) rather than strict enforcement. See also: class, attribute, property.
enumerate() (Ch. 5, §5.3): A built-in function that pairs each item in an iterable with its index: for i, item in enumerate(lst). See also: for loop, iterable.
Exception (Ch. 11, §11.1): An event that occurs during program execution that disrupts the normal flow of instructions. Handled with try/except. See also: try/except, raise, traceback.
Expression (Ch. 3, §3.4): A combination of values, variables, operators, and function calls that Python evaluates to produce a value. Examples: 2 + 3, x * y, len("hello"). See also: statement, operator.
f-string (Ch. 3, §3.6): A string literal prefixed with f that allows embedding expressions inside curly braces: f"Hello, {name}!". Introduced in Python 3.6. See also: string, string formatting.
Factory pattern (Ch. 16, §16.3): A design pattern where a function or method creates and returns objects without specifying the exact class. See also: design pattern, Strategy pattern, Observer pattern.
FIFO (First In, First Out) (Ch. 20, §20.3): The ordering principle of a queue: the first item added is the first to be removed. See also: queue, LIFO.
File object (Ch. 10, §10.1): An object that provides methods for reading from or writing to a file. Created by the open() function. See also: context manager, with statement.
for loop (Ch. 5, §5.2): A loop that iterates over each item in a sequence or iterable. See also: while loop, range(), iterable.
Fork (Ch. 25, §25.5): On GitHub, creating a personal copy of someone else's repository. Used to propose changes to open-source projects. See also: clone, pull request.
Function (Ch. 6, §6.1): A named block of reusable code that performs a specific task. Defined with def. May accept parameters and return a value. See also: parameter, return value, scope, docstring.
Git (Ch. 25, §25.1): A distributed version control system that tracks changes to source code over time. See also: version control, commit, branch, merge, repository.
.gitignore (Ch. 25, §25.2): A file that tells Git which files and directories to exclude from version control. Common entries: venv/, __pycache__/, .env. See also: Git, repository.
Global variable (Ch. 6, §6.5): A variable defined at the module level, outside any function. Accessible everywhere but should be used sparingly. See also: local variable, scope.
Graph (Ch. 20, §20.6): A data structure consisting of vertices (nodes) connected by edges. Previewed in Ch. 20 as motivation for CS2. See also: tree, linked list, abstract data type.
Greedy algorithm (Ch. 17, §17.4): An algorithm that makes the locally optimal choice at each step, hoping to find the global optimum. Doesn't always produce the best solution. See also: brute force, divide and conquer.
Hash (Ch. 9, §9.1): A fixed-size numeric value computed from an object, used for fast lookup in dictionaries and sets. Only immutable (hashable) objects can be dictionary keys or set elements. See also: dictionary, set, immutable.
Hash table (Ch. 20, §20.6): The underlying data structure behind Python dictionaries and sets. Uses hashing for O(1) average-case lookups. See also: hash, dictionary, set.
"Has-a" relationship (Ch. 15, §15.5): A relationship where one object contains another as an attribute. Modeled through composition. Example: a Car has an Engine. See also: composition, "is-a" relationship.
HTML (Ch. 24, §24.1): HyperText Markup Language, the standard markup language for web pages. Parsed in web scraping. See also: web scraping, Beautiful Soup, CSS selector.
HTTP (Ch. 21, §21.3): HyperText Transfer Protocol, the protocol used for communication between web clients and servers. Common methods: GET, POST. See also: API, REST, status code.
IDE (Integrated Development Environment) (Ch. 2, §2.3): A software application that provides comprehensive facilities for software development, including a code editor, terminal, debugger, and extensions. VS Code is the IDE used in this textbook. See also: terminal, REPL.
Immutable (Ch. 7, §7.2): An object whose value cannot be changed after creation. Strings, tuples, integers, and frozensets are immutable in Python. See also: mutable, string, tuple.
Import (Ch. 12, §12.1): A statement that loads a module or specific names from a module into the current namespace. See also: module, package, namespace.
Indentation (Ch. 2, §2.4): The spaces at the beginning of a line that define code blocks in Python. Standard practice: 4 spaces per level. See also: syntax, block.
Infinite loop (Ch. 5, §5.5): A loop whose condition never becomes false, causing the program to run indefinitely. Stopped with Ctrl+C. See also: while loop, break, bug.
Inheritance (Ch. 15, §15.1): A mechanism where a new class (child/subclass) is created from an existing class (parent/superclass), inheriting its attributes and methods. See also: parent class, child class, method overriding, super().
__init__ (Ch. 14, §14.2): The constructor method of a Python class. Called automatically when a new instance is created. See also: constructor, class, self.
Input validation (Ch. 4, §4.5): The practice of checking user input for correctness before using it in calculations. Prevents crashes and incorrect results. See also: while loop, exception.
Insertion sort (Ch. 19, §19.4): A sorting algorithm that builds the sorted array one item at a time by inserting each element into its correct position. O(n²) worst case, but efficient for small or nearly-sorted data. See also: selection sort, merge sort, Big-O notation.
Instance (Ch. 14, §14.1): A specific object created from a class. fido = Dog("Fido") creates an instance of the Dog class. See also: class, object, instance attribute.
Instance attribute (Ch. 14, §14.2): An attribute that belongs to a specific instance, set in __init__ using self.name = value. Each instance has its own copy. See also: class attribute, self.
Interpreter (Ch. 2, §2.2): A program that executes source code line by line, without compiling it to machine code first. Python is an interpreted language. See also: compiler, REPL.
"Is-a" relationship (Ch. 15, §15.1): A relationship where a child class is a specialized version of a parent class. Modeled through inheritance. Example: a GuideDog is a Dog. See also: inheritance, "has-a" relationship.
Iterable (Ch. 5, §5.2): Any Python object that can be iterated over in a for loop. Includes strings, lists, tuples, dictionaries, sets, files, and ranges. See also: for loop, iterator.
Iteration (Ch. 5, §5.1): The process of repeating a block of code, typically using a for or while loop. See also: for loop, while loop, recursion.
JSON (JavaScript Object Notation) (Ch. 10, §10.6): A lightweight data interchange format based on key-value pairs and arrays. Widely used for API responses and configuration files. See also: CSV, API, dictionary.
Key (Ch. 9, §9.1): In a dictionary, the unique identifier used to look up a value. Must be hashable (immutable). See also: dictionary, value, hash.
Keyword argument (Ch. 6, §6.3): An argument passed to a function using the syntax name=value, allowing arguments to be specified in any order. See also: argument, default parameter.
Lambda (Ch. 19, §19.5): An anonymous (unnamed) function defined with the lambda keyword. Typically used for short operations passed as arguments: sorted(words, key=lambda w: len(w)). See also: function, key function.
LBYL (Look Before You Leap) (Ch. 11, §11.4): A coding style that checks conditions before performing an operation. Contrasted with EAFP. See also: EAFP, conditional.
LIFO (Last In, First Out) (Ch. 20, §20.2): The ordering principle of a stack: the last item added is the first to be removed. See also: stack, FIFO.
Linear search (Ch. 19, §19.1): A search algorithm that checks each element sequentially until the target is found or the end is reached. O(n) time. See also: binary search, Big-O notation.
Linked list (Ch. 20, §20.5): A data structure where each element (node) contains data and a reference (pointer) to the next node. Previewed in Ch. 20 as motivation for CS2. See also: node, abstract data type, list.
List (Ch. 8, §8.1): A mutable, ordered sequence of elements enclosed in square brackets. Supports indexing, slicing, and a variety of methods. See also: tuple, list comprehension, mutable.
List comprehension (Ch. 8, §8.5): A concise syntax for creating lists: [expression for item in iterable if condition]. See also: list, dictionary comprehension.
Local variable (Ch. 6, §6.5): A variable defined inside a function, accessible only within that function. Created when the function is called, destroyed when it returns. See also: global variable, scope, stack frame.
Logic error (Ch. 3, §3.7): A bug where the program runs without crashing but produces incorrect results. The hardest type of error to find. See also: syntax error, runtime error, debugging.
Loop (Ch. 5, §5.1): A control structure that repeats a block of code. Python has two types: for loops and while loops. See also: for loop, while loop, iteration.
Loop variable (Ch. 5, §5.2): The variable that takes on successive values during a for loop: for i in range(10) — i is the loop variable. See also: for loop, range().
match/case (Ch. 4, §4.7): A structural pattern matching statement introduced in Python 3.10. Similar to switch/case in other languages but more powerful. See also: conditional.
Memoization (Ch. 18, §18.5): An optimization technique that stores the results of expensive function calls and returns the cached result when the same inputs occur again. See also: recursion, dynamic programming.
Merge (Ch. 25, §25.4): In Git, combining changes from one branch into another. See also: branch, merge conflict.
Merge conflict (Ch. 25, §25.4): In Git, a situation where two branches have made incompatible changes to the same lines of code. Must be resolved manually. See also: merge, branch.
Merge sort (Ch. 19, §19.5): A divide-and-conquer sorting algorithm that splits the list in half, recursively sorts each half, and merges the sorted halves. O(n log n) time. See also: divide and conquer, recursion, selection sort.
Method (Ch. 7, §7.3): A function that belongs to an object. Called using dot notation: "hello".upper(). See also: function, class, self.
Method overriding (Ch. 15, §15.2): Defining a method in a child class with the same name as a method in the parent class, replacing the parent's behavior. See also: inheritance, polymorphism, super().
Method resolution order (MRO) (Ch. 15, §15.6): The order in which Python searches for methods in a class hierarchy, especially with multiple inheritance. See also: inheritance, multiple inheritance.
Mock (Ch. 13, §13.4): A test double that replaces a real object in unit tests, allowing you to test a component in isolation. See also: unit test, testing, fixture.
Module (Ch. 12, §12.1): A Python file (.py) containing definitions (functions, classes, variables) that can be imported and used in other programs. See also: package, import, standard library.
Multiple inheritance (Ch. 15, §15.6): A feature where a class inherits from more than one parent class. Powerful but can lead to complexity (the "diamond problem"). See also: inheritance, method resolution order.
Mutable (Ch. 8, §8.1): An object whose value can be changed after creation. Lists, dictionaries, and sets are mutable. See also: immutable, aliasing, list.
MVP (Minimum Viable Product) (Ch. 26, §26.3): The simplest version of a product that delivers enough functionality to be useful and testable. See also: Agile, sprint.
Namespace (Ch. 12, §12.2): A mapping from names to objects. Each module, function, and class creates its own namespace. See also: scope, import, module.
Nested conditional (Ch. 4, §4.4): An if statement inside another if statement. Can often be simplified to a flat if-elif-else chain. See also: conditional.
Node (Ch. 20, §20.5): A basic unit of a data structure (linked list, tree, graph) containing data and references to other nodes. See also: linked list, tree, graph.
None (Ch. 6, §6.4): Python's null value, representing the absence of a value. The default return value of functions that don't explicitly return something. See also: return value, truthiness.
Object (Ch. 14, §14.1): An instance of a class. Everything in Python is an object — integers, strings, lists, functions, and user-defined types. See also: class, instance, method, attribute.
Observer pattern (Ch. 16, §16.3): A design pattern where an object (subject) maintains a list of dependents (observers) and notifies them of state changes. See also: design pattern, Strategy pattern, coupling.
Off-by-one error (Ch. 5, §5.5): A common bug where a loop iterates one time too many or one time too few, often caused by confusion about whether a range boundary is inclusive or exclusive. See also: loop, range(), bug.
Open/Closed Principle (Ch. 16, §16.1): A SOLID principle stating that software entities should be open for extension but closed for modification. See also: SOLID, inheritance, design pattern.
Operator (Ch. 3, §3.4): A symbol that performs an operation on one or more operands. Arithmetic: +, -, *, /, //, %, **. Comparison: ==, !=, <, >. Boolean: and, or, not. See also: expression, operator precedence.
Package (Ch. 12, §12.3): A directory of Python modules organized hierarchically, containing an __init__.py file. See also: module, import, pip.
Pagination (Ch. 21, §21.4): The practice of dividing API responses into pages, each containing a limited number of results. See also: API, REST.
Parameter (Ch. 6, §6.2): A variable name in a function definition that receives a value when the function is called. Distinguished from argument, which is the actual value passed. See also: argument, default parameter, keyword argument.
pathlib (Ch. 10, §10.4): A standard library module providing object-oriented filesystem path manipulation. The Path class is the modern way to work with file paths in Python. See also: file I/O, module.
Pattern recognition (Ch. 1, §1.2): One of the four pillars of computational thinking. Finding similarities or recurring patterns in problems. See also: computational thinking, algorithm.
pip (Ch. 12, §12.5): Python's package installer, used to install third-party packages from the Python Package Index (PyPI). See also: package, virtual environment, PyPI.
Polymorphism (Ch. 15, §15.3): The ability of different object types to respond to the same method call in different ways. A dog's speak() returns "Woof!", a cat's returns "Meow!" See also: method overriding, inheritance, abstract base class.
print() (Ch. 2, §2.4): A built-in function that outputs text to the screen. Accepts sep (separator) and end (line ending) keyword arguments. See also: f-string, function.
Program (Ch. 1, §1.1): A set of instructions written in a programming language that a computer can execute. See also: algorithm, software.
@property (Ch. 14, §14.5): A decorator that lets you define a method that is accessed like an attribute, providing controlled access to internal data. See also: encapsulation, decorator, class.
Pseudocode (Ch. 17, §17.3): An informal, human-readable description of an algorithm that uses natural language mixed with programming-like structure. Not executable. See also: algorithm, tracing.
Pull request (Ch. 25, §25.5): On GitHub, a request to merge changes from one branch into another, providing a forum for code review and discussion. See also: Git, branch, code review.
PyPI (Python Package Index) (Ch. 23, §23.2): The official repository of third-party Python packages, hosted at pypi.org. See also: pip, package.
pytest (Ch. 13, §13.1): A popular third-party testing framework for Python. Simpler and more Pythonic than unittest. See also: unit test, testing, assertion.
Queue (Ch. 20, §20.3): An abstract data type that follows FIFO (First In, First Out) ordering. Items are added at the back and removed from the front. See also: FIFO, stack, deque.
raise (Ch. 11, §11.3): A statement that triggers an exception. Used to signal error conditions: raise ValueError("Invalid input"). See also: exception, try/except.
range() (Ch. 5, §5.2): A built-in function that generates a sequence of integers. range(n) produces 0 through n-1. See also: for loop, loop variable.
Rate limiting (Ch. 21, §21.4): A restriction on how many API requests can be made within a given time period. Exceeding the limit typically results in HTTP 429 errors. See also: API, HTTP.
Read mode (Ch. 10, §10.1): The default file opening mode ("r"), which allows reading but not writing. See also: write mode, append mode.
Recursion (Ch. 18, §18.1): A technique where a function calls itself to solve a problem by breaking it into smaller instances of the same problem. See also: base case, recursive case, call stack, memoization.
Recursive case (Ch. 18, §18.1): The part of a recursive function that makes a recursive call, reducing the problem toward the base case. See also: recursion, base case.
Refactoring (Ch. 16, §16.3): Restructuring existing code without changing its external behavior, to improve readability, reduce complexity, or fix code smells. See also: code smell, design pattern.
Regression test (Ch. 13, §13.2): A test that ensures previously working functionality hasn't been broken by new changes. See also: unit test, testing.
Regular expression (regex) (Ch. 22, §22.1): A pattern language for matching and manipulating text. Python provides the re module. See also: re module, pattern matching.
Remote (Ch. 25, §25.5): In Git, a version of a repository hosted on a server (e.g., GitHub). See also: Git, push, pull, clone.
REPL (Read-Eval-Print Loop) (Ch. 2, §2.3): An interactive environment where you type Python code, it executes immediately, and the result is displayed. Launched with the python3 command. See also: interpreter, IDE.
Repository (Ch. 25, §25.1): A Git project containing all files, commit history, and branches. Can be local or remote. See also: Git, commit, remote.
requests (Ch. 21, §21.3): A popular third-party Python library for making HTTP requests. Simplifies API interaction. See also: API, HTTP, pip.
REST (Representational State Transfer) (Ch. 21, §21.3): An architectural style for web APIs that uses standard HTTP methods (GET, POST, PUT, DELETE) to interact with resources. See also: API, HTTP, JSON.
Return value (Ch. 6, §6.2): The value a function sends back to its caller using the return statement. If no return is executed, the function returns None. See also: function, None.
Runtime error (Ch. 3, §3.7): An error that occurs while the program is running (as opposed to a syntax error, which is caught before execution). Examples: TypeError, ValueError, ZeroDivisionError. See also: syntax error, logic error, exception.
Scope (Ch. 6, §6.5): The region of a program where a variable name is accessible. Python has local, enclosing, global, and built-in scopes (LEGB rule). See also: local variable, global variable, namespace.
Scrum (Ch. 26, §26.3): An Agile framework that organizes work into time-boxed iterations called sprints, typically 2-4 weeks long. See also: Agile, sprint, backlog.
self (Ch. 14, §14.2): The conventional name for the first parameter of an instance method, referring to the object the method is called on. See also: method, instance, class.
Selection sort (Ch. 19, §19.3): A sorting algorithm that repeatedly finds the minimum element and places it at the front. O(n²) time. Simple but inefficient. See also: insertion sort, merge sort, Big-O notation.
Semantic versioning (Ch. 23, §23.3): A versioning scheme (MAJOR.MINOR.PATCH) where incrementing the major version indicates breaking changes, minor means new features, and patch means bug fixes. See also: dependency, package.
Sentinel value (Ch. 5, §5.5): A special value used to signal the end of input in a loop. Example: entering "quit" to stop, or 0 to end donation input. See also: while loop, input validation.
Set (Ch. 9, §9.5): An unordered collection of unique, hashable elements. Supports mathematical set operations (union, intersection, difference). See also: dictionary, hash, set operations.
Shallow copy (Ch. 8, §8.7): A copy that duplicates the top-level structure but shares references to nested objects. Created with lst.copy() or lst[:]. See also: deep copy, aliasing.
Shell (Ch. 2, §2.3): The program that interprets commands typed in the terminal. Examples: Bash, Zsh (macOS/Linux), PowerShell, Command Prompt (Windows). See also: terminal, command line.
Short-circuit evaluation (Ch. 4, §4.3): Boolean optimization where and stops evaluating at the first False, and or stops at the first True. See also: Boolean operator, EAFP.
Single Responsibility Principle (Ch. 16, §16.1): A SOLID principle stating that a class or function should have one reason to change — it should do one thing well. See also: SOLID, cohesion, refactoring.
Slice (Ch. 7, §7.2): A way to extract a subsequence from a string, list, or tuple using [start:stop:step] syntax. See also: indexing, string, list.
Software (Ch. 1, §1.1): Programs and associated data that tell a computer what to do. Distinguished from hardware, which is the physical equipment. See also: program, hardware.
SOLID (Ch. 16, §16.1): Five principles of object-oriented design: Single Responsibility, Open/Closed, Liskov Substitution, Interface Segregation, Dependency Inversion. This textbook covers the first two in depth. See also: Single Responsibility Principle, Open/Closed Principle.
sorted() (Ch. 8, §8.4): A built-in function that returns a new sorted list from any iterable. Accepts key and reverse parameters. Does not modify the original. See also: .sort(), key function, lambda.
Space complexity (Ch. 17, §17.2): The amount of memory an algorithm uses relative to input size. See also: time complexity, Big-O notation.
Special method (dunder method) (Ch. 14, §14.3): A method with double underscores before and after the name (__init__, __str__, __eq__, etc.) that Python calls automatically in response to certain operations. See also: class, operator overloading.
Sprint (Ch. 26, §26.3): In Scrum, a fixed time period (usually 2-4 weeks) during which a specific set of work must be completed and made ready for review. See also: Scrum, Agile, backlog.
Stack (Ch. 20, §20.2): An abstract data type that follows LIFO (Last In, First Out) ordering. Items are pushed onto the top and popped from the top. See also: LIFO, queue, call stack.
Stack frame (Ch. 6, §6.5): A record on the call stack containing a function's local variables, parameters, and return address. Created when a function is called, destroyed when it returns. See also: call stack, scope, local variable.
Stack overflow (Ch. 18, §18.4): An error that occurs when the call stack exceeds its maximum depth, usually due to infinite recursion. Python raises RecursionError. See also: recursion, base case, call stack.
Staging area (Ch. 25, §25.2): In Git, an intermediate area where changes are collected before being committed. Files are added to the staging area with git add. See also: commit, Git.
Standard library (Ch. 12, §12.4): The collection of modules included with every Python installation, requiring no extra installation. Includes math, random, datetime, os, json, csv, re, unittest, and many more. See also: module, import, pip.
Statement (Ch. 3, §3.1): An instruction that Python executes. Statements include assignments, function calls, if statements, loops, and import. See also: expression.
Status code (Ch. 21, §21.3): An HTTP response code indicating the result of a request. Common codes: 200 (OK), 404 (Not Found), 500 (Server Error), 429 (Rate Limited). See also: HTTP, API.
Strategy pattern (Ch. 16, §16.3): A design pattern that defines a family of algorithms, encapsulates each one, and makes them interchangeable. See also: design pattern, Observer pattern, polymorphism.
String (Ch. 3, §3.3): An immutable sequence of characters, enclosed in single quotes, double quotes, or triple quotes. See also: immutable, f-string, string method, slice.
super() (Ch. 15, §15.2): A built-in function that returns a proxy object allowing a child class to call methods of its parent class. Commonly used in __init__ and overridden methods. See also: inheritance, method overriding, parent class.
Syntax (Ch. 2, §2.4): The rules governing the structure of valid Python code. See also: syntax error, indentation.
Syntax error (Ch. 2, §2.5): An error caused by code that violates Python's grammatical rules. Caught before the program runs. See also: runtime error, logic error, bug.
TDD (Test-Driven Development) (Ch. 13, §13.3): A development practice where you write a failing test first, then write the minimum code to pass it, then refactor. Red-Green-Refactor cycle. See also: unit test, pytest, testing.
Technical debt (Ch. 26, §26.5): The accumulated cost of shortcuts and quick fixes in code that will need to be addressed later. See also: refactoring, code smell.
Terminal (Ch. 2, §2.3): A text-based interface for typing commands to the operating system. See also: shell, command line, REPL.
Test case (Ch. 13, §13.1): A single test that verifies one specific behavior of a piece of code. See also: test suite, unit test, assertion.
Test suite (Ch. 13, §13.1): A collection of test cases that together verify the behavior of a program or module. See also: test case, unit test, code coverage.
Time complexity (Ch. 17, §17.2): The amount of time an algorithm takes relative to input size. Expressed using Big-O notation. See also: space complexity, Big-O notation.
Timsort (Ch. 19, §19.6): Python's built-in sorting algorithm (used by sorted() and .sort()). A hybrid of merge sort and insertion sort. O(n log n) worst case. See also: merge sort, insertion sort, sorted().
Traceback (Ch. 11, §11.1): The error report Python displays when an unhandled exception occurs. Shows the chain of function calls that led to the error, from most recent to earliest. See also: exception, debugging.
Tracing (Ch. 17, §17.3): The process of manually stepping through code line by line, tracking variable values. A fundamental debugging and analysis technique. See also: pseudocode, debugging.
Tree (Ch. 20, §20.6): A hierarchical data structure where each node has zero or more child nodes. Previewed in Ch. 20 as motivation for CS2. See also: node, graph, recursion.
Truthiness (Ch. 4, §4.2): The concept that non-Boolean values can be evaluated as True or False. Falsy values in Python: False, 0, 0.0, "", [], (), {}, set(), None. Everything else is truthy. See also: Boolean, conditional.
Try/except (Ch. 11, §11.2): The exception handling mechanism in Python. Code that might fail goes in the try block; error handling code goes in except blocks. See also: exception, EAFP, raise.
Tuple (Ch. 8, §8.6): An immutable, ordered sequence of elements enclosed in parentheses. Often used for fixed collections of related data (like coordinates or database records). See also: list, immutable, unpacking.
Type casting (Ch. 3, §3.5): Converting a value from one type to another using functions like int(), float(), str(), bool(). See also: data type, TypeError, ValueError.
type() (Ch. 3, §3.3): A built-in function that returns the type of an object. See also: data type, isinstance().
Unit test (Ch. 13, §13.1): A test that verifies the behavior of a single function or method in isolation. See also: test case, pytest, TDD.
Unpacking (Ch. 8, §8.6): Assigning the elements of a sequence to multiple variables in a single statement: a, b, c = [1, 2, 3]. See also: tuple, star unpacking.
User story (Ch. 26, §26.3): In Agile, a short description of a feature from the user's perspective: "As a [role], I want [feature] so that [benefit]." See also: Agile, backlog, sprint.
Value (Ch. 9, §9.1): In a dictionary, the data associated with a key. Values can be any type. See also: key, dictionary.
Variable (Ch. 3, §3.1): A name that refers to a value stored in memory. In Python, variables are name tags pointing to objects, not boxes containing values. See also: assignment, scope, type.
Version control (Ch. 25, §25.1): A system that records changes to files over time, allowing you to recall specific versions later. Git is the most widely used version control system. See also: Git, commit, repository.
Virtual environment (Ch. 23, §23.1): An isolated Python environment with its own interpreter and packages, preventing dependency conflicts between projects. Created with python -m venv. See also: pip, dependency, package.
Waterfall (Ch. 26, §26.2): A software development methodology where phases (requirements, design, implementation, testing, deployment) proceed sequentially. See also: Agile, SDLC.
Web scraping (Ch. 24, §24.1): The automated extraction of data from web pages using programs. See also: Beautiful Soup, HTML, robots.txt, automation.
while loop (Ch. 5, §5.4): A loop that repeats as long as a condition is true. Used when the number of iterations is not known in advance. See also: for loop, infinite loop, sentinel value.
with statement (Ch. 10, §10.1): A statement that wraps the execution of a block of code with methods defined by a context manager, ensuring proper resource cleanup. See also: context manager, file I/O.
Write mode (Ch. 10, §10.2): A file opening mode ("w") that creates a new file or overwrites an existing one. See also: read mode, append mode.
zip() (Ch. 5, §5.3): A built-in function that pairs up elements from two or more iterables: list(zip([1,2], ["a","b"])) gives [(1,"a"), (2,"b")]. See also: for loop, enumerate(), tuple.
This glossary covers over 200 terms from all 27 chapters. For quick syntax lookup, see Appendix A. For concept definitions organized by topic rather than alphabetically, use the Index (Appendix F).