Glossary

297 terms from Introduction to Computer Science with Python

# A B C D E F G H I K L M N O P Q R S T U V W

#

"Changes to be committed: modified: storage.py"
`storage.py` has been modified and staged with `git add`. It will be included in the next commit. - **"Changes not staged for commit: modified: display.py"** — `display.py` has been modified but NOT staged. It will NOT be included in the next commit unless you run `git add display.py`. - **"Untracke → Quiz: Version Control with Git
"smoke test"
does the thing turn on without catching fire? → Case Study 1: The History of "Hello, World!"
10.1
10.7 append mode, **10.2** `open()`, **10.1** read mode, **10.1** `read()`, **10.1** `readline()`, **10.1** `readlines()`, **10.1** write mode, **10.2** `write()`, **10.2** `writelines()`, **10.2** `filter()`, 17.5, A.11 `finally` clause, **11.2**, 11.3 `float` type, **3.3**, 3.5 floating-point prec → Appendix F: Index
12.1
12.5 `__name__`, **12.3** `__main__`, **12.3** multiple inheritance, **15.6** mutable, **8.1**, 8.7, 9.1 MVP (Minimum Viable Product), **26.3** → Appendix F: Index
13.1
13.5 time complexity, **17.2**, 19.1-19.6 Timsort, **19.6** traceback, **11.1**, 11.2, 13.3 tracing (hand execution), **17.3**, 18.1 tree (data structure), **20.6**, 18.3 `True`, **3.3**, 4.2 truth table, **4.3**, C.2 truthiness, **4.2**, 3.3 `try`/`except`, **11.2**, 11.3 tuple, **8.6**, 8.7 unpack → Appendix F: Index
14.1
16.5 Observer pattern, **16.3**, 16.4 off-by-one error, **5.5**, 8.1 `open()`, **10.1**, 10.2 Open/Closed Principle, **16.1** operator, **3.4**, 4.3 arithmetic, **3.4** Boolean, **4.3** comparison, **3.4** membership (`in`, `not in`), **5.2**, 9.1 precedence, 3.4, 4.3, C.2 `or` operator, **4.3**, C. → Appendix F: Index
22.1
22.5 `findall()`, **22.3** `match()`, **22.2** `search()`, **22.2** `sub()`, **22.4** read mode (file), **10.1** recursion, **18.1**-18.5 base case, **18.1** recursive case, **18.1** tail recursion, 18.5 tree recursion, **18.3** vs. iteration, **18.4** refactoring, **16.3**, 16.5 regression test, ** → Appendix F: Index
24.1
24.4 `while` loop, **5.4**, 5.5 `with` statement, **10.1**, 10.2 write mode (file), **10.2** → Appendix F: Index
25.1
25.5 `git add`, **25.2** `git branch`, **25.3** `git checkout`, **25.3** `git clone`, **25.5** `git commit`, **25.2** `git diff`, 25.2 `git init`, **25.1** `git log`, 25.2 `git merge`, **25.4** `git pull`, **25.5** `git push`, **25.5** `git status`, 25.2 `.gitignore`, **25.2** GitHub, **25.5**, 26.4 → Appendix F: Index
26.1
26.5 `self`, **14.2**, 14.3 selection sort, **19.3**, 19.6 Selenium, 24.5 semantic versioning, **23.3** sentinel value, **5.5**, 5.6 set, **9.5**, 9.6 `add()`, **9.5** `difference()` / `-`, **9.5** `discard()`, **9.5** `intersection()` / `&`, **9.5** `remove()`, **9.5** `symmetric_difference()` / `^ → Appendix F: Index
8.1
8.8 comprehension, **8.5**, 8.6 methods, see `append()`, `extend()`, `insert()`, `pop()`, `remove()`, `sort()`, `copy()` nested, **8.8**, 19.5 slicing, **8.1**, 7.1 local variable, **6.5**, 6.6 logic error, **3.7**, 13.3, D.4 loop, **5.1**-5.6 `else` clause, **5.6** `for`, **5.2** infinite, **5.5** → Appendix F: Index
`__pycache__/`
contains compiled bytecode files that Python generates automatically. They're machine-specific and regenerated every time you run the code. 2. **`venv/`** — virtual environment directories contain installed packages and Python binaries that are large, machine-specific, and reproducible from `require → Quiz: Version Control with Git
`append([4, 5])` vs. `extend([4, 5])`
append adds one element (the list itself); extend adds each element → Key Takeaways: Lists and Tuples
`DeadlineTask`
a task with a due date that can be overdue 2. **`RecurringTask`** — a task with a frequency (daily, weekly, monthly) that resets when completed 3. **`ChecklistTask`** — a task with sub-items that tracks partial progress → Chapter 15: Inheritance and Polymorphism: Building on What Exists
`def`
The keyword that tells Python "I'm defining a function." Short for *define*. - **`greet`** — The function's name. Same naming rules as variables: lowercase, underscores, descriptive. - **`(name)`** — The **parameter list**. This function expects one piece of data, which it will call `name` internall → Chapter 6: Functions: Writing Reusable Code
`False`
d) `True and True and False` → **`False`** (the last `False` makes the whole thing false) - e) `False or False or True` → **`True`** (the last `True` makes it true) - f) `not (True and False)` → `not False` → **`True`** - g) `True or False and False` → `True or (False and False)` → `True or False` → → Appendix G: Answers to Selected Exercises
`for`
Are you waiting for something to happen? → **`while`** - Iterating over a collection (string, list, etc.)? → **`for`** - Menu-driven program or input validation? → **`while`** → Key Takeaways: Repetition: Loops and Iteration
`good first issue`
Specifically chosen as approachable for new contributors - **`help wanted`** — The maintainers would welcome outside help - **`bug`** — Something is broken - **`enhancement`** — A proposed improvement - **`documentation`** — Improvements to docs (often the easiest entry point) → Case Study: The Open Source World — How to Contribute and Grow
`main`
the development branch for the next major release - **`3.12`**, **`3.13`**, etc. — maintenance branches for released versions that receive bug fixes and security patches → Case Study: How Open Source Projects Use Git
`search_tasks`
searches tasks in the current category, then recurses into every subcategory. It doesn't need to know how deep the tree goes. - **`count_all_tasks`** — counts tasks at this level, then adds the counts from all subcategories. - **`display_tree`** — prints this category, then recursively prints each s → Chapter 18: Recursion: Functions That Call Themselves
`Stack` and `Queue` classes
the ones you built in this chapter. 2. **`UndoableAction` class** — a record that stores what was done (add or delete), which task was affected, and where it was in the list (for accurate restoration). 3. **New methods on `TaskFlow`:** `undo()`, `redo()`, `schedule_task()`, `process_next()`. → Chapter 20: Intro to Data Structures: Stacks, Queues, and Beyond
`Task` is a dataclass
clean, minimal boilerplate, auto-generated `__repr__` and `__eq__` - **Observer pattern** — `TaskManager` doesn't know about console output or logging details; it just notifies observers - **Loose coupling** — you can swap `ConsoleNotifier` for an `EmailNotifier` without touching `TaskManager` - **H → Chapter 16: OOP Design: Patterns and Principles
`time.sleep(delay)`
Rate limiting. Don't hammer the server (Section 24.5). 2. **A descriptive `User-Agent` header** -- The default `python-requests/2.x` is often blocked. Transparency is both polite and practical. 3. **Error handling** -- Networks fail, servers go down. `try/except` and `timeout=10` ensure graceful fai → Chapter 24: Web Scraping and Automation

A

abstract data type
which separates *what* a data structure does from *how* it does it. → Chapter 20: Intro to Data Structures: Stacks, Queues, and Beyond
abstract data types
separating what a data structure does from how it's implemented. → Chapter 20: Intro to Data Structures: Stacks, Queues, and Beyond
abstraction
one of the four pillars from Chapter 1. Python abstracts away the details of memory management (you never manually allocate or free memory), but understanding the *concept* of names pointing to objects helps you predict how your programs will behave. This is exactly the kind of "thinking behind the → Chapter 3: Variables, Types, and Expressions: The Building Blocks
abstraction through functions
is a shift in thinking that will affect everything you write from here on. You're no longer writing one long script. You're building programs from composable, reusable, well-named pieces. → Chapter 6: Functions: Writing Reusable Code
accumulator pattern
initialize before the loop, update inside, use after — is the fundamental technique for building results from repeated operations. - `break` exits a loop early, `continue` skips to the next iteration, and `else` on a loop runs only if no `break` occurred. - **Nested loops** run the inner loop to com → Chapter 5: Repetition: Loops and Iteration
adaptive
its performance depends on how much disorder exists in the input. For each element, the inner `while` loop only runs while there are larger elements to the left that need shifting. In nearly-sorted data, most elements are already close to their correct position, so the inner loop barely executes. Th → Chapter 19 Quiz
Add a GUI
Use `tkinter` (built-in) or `PyQt` to give TaskFlow a graphical interface 2. **Add a web interface** — Use Flask or FastAPI to make TaskFlow accessible from a browser 3. **Add a database** — Replace JSON storage with SQLite (built into Python's `sqlite3` module) 4. **Add collaboration** — Let multip → Chapter 27: What's Next: Pathways in Computer Science
Adding tasks
verify a task is added with correct fields 2. **Deleting tasks** — verify deletion by index, handle invalid indices 3. **Searching tasks** — keyword search, case-insensitive matching 4. **Saving/loading JSON** — round-trip persistence (save, then load, verify data) 5. **Error handling** — invalid in → Chapter 13: Testing and Debugging: Writing Code You Can Trust
search tasks with regex patterns, not just plain keywords 2. **Natural language date parsing** — interpret inputs like `"next Tuesday"` or `"tomorrow"` as actual dates → Chapter 22: Regular Expressions: Pattern Matching Power
Advent of Code
25 programming puzzles released each December. Fun, challenging, and great for practicing algorithms. - **LeetCode / HackerRank** — Coding challenges organized by difficulty and topic. Useful for interview preparation. - **Hackathons** — Timed events where you build a project (usually in 24-48 hours → Chapter 27: What's Next: Pathways in Computer Science
algorithmic intuition
the ability to look at a problem and reason about which approach will scale and which will break down. This is one of the most valuable skills in computer science, and it extends far beyond sorting and searching. In Chapter 20, you'll apply this same thinking to stacks, queues, and other abstract da → Chapter 19: Searching and Sorting: Classic Algorithms
Almost never
pollutes namespace unpredictably | → Chapter 12: Modules, Packages, and the Python Ecosystem
API key
a unique string that identifies your application: → Chapter 21: Working with Data: CSV, JSON, and APIs
APIs
Application Programming Interfaces. And at their core, they work exactly like the functions you wrote in this chapter: they take inputs (parameters), do some work, and return outputs (return values). → Case Study: How APIs Work — Functions All the Way Down
Artificial Intelligence and Machine Learning
How to build systems that learn from data and make decisions. We'll discuss this more in Section 27.4, but the foundations you've built — data structures, algorithms, file I/O, and working with libraries — are exactly what you need to start learning AI/ML. → Chapter 27: What's Next: Pathways in Computer Science
As a reviewer:
Critique the *code*, not the *person*. "This function is hard to follow" not "You wrote confusing code." - Ask questions instead of making demands. "Could this be simplified by...?" invites collaboration. - Acknowledge what's done well. "Nice use of `max()` here — that's cleaner than the if/else" co → Chapter 26: Software Development Lifecycle
As the author:
Don't take feedback personally. The reviewer is improving the *code*, not judging *you*. - Assume good intent. If a comment seems harsh, it's probably just tersely written — reviewers are busy. - Push back when you disagree, but explain your reasoning. "I chose X because of Y" is productive; "I like → Chapter 26: Software Development Lifecycle
Assigned as self-study (not covered in class):
Ch 1 (Welcome to CS) — Assign as pre-reading before Week 1. Students read it before the first session. - Ch 7 (Strings) — Covered briefly within Ch 8 session. Assign the chapter as reading; discuss string methods for 15 minutes before diving into lists. - Ch 12 (Modules and Packages) — Assign as rea → Syllabus: 10-Week Accelerated Quarter
assignment operator
it gives a value to a variable (`x = 5`). `==` is the **equality comparison operator** — it checks whether two values are equal and returns `True` or `False` (`x == 5`). Confusing them is one of the most common beginner bugs, and we'll revisit it in detail in this chapter. → Chapter 4: Making Decisions: Conditionals and Boolean Logic
automation as a multiplier
is this: every hour spent writing an automation script pays for itself many times over. Elena spent 8 hours building her pipeline. It saves her 200 hours per year. But more than speed, the script is *reliable*. It doesn't get tired, doesn't make transcription errors, and doesn't forget to validate t → Chapter 24: Web Scraping and Automation
Avoid circular imports
if A imports B and B imports A, restructure. 3. **Keep side effects out of module-level code** — put initialization inside functions or `__name__` guards. 4. **One responsibility per module** — if you describe it with "and," split it. 5. **Check the standard library first** — before writing a utilit → Key Takeaways: Modules, Packages, and the Python Ecosystem

B

base case
the stopping condition. Everything before it is the **recursive case** — the step that makes the problem smaller and hands it off to the same process. → Chapter 18: Recursion: Functions That Call Themselves
O(log n). - Linear scan worst case: 1,000,000 comparisons (check every name). - Binary search worst case: log₂(1,000,000) ≈ 20 comparisons. → Quiz: Algorithms and Problem-Solving Strategies
binary tree
where each node has at most two children — is the foundation of binary search trees (BSTs), which provide O(log n) search, insert, and delete. → Chapter 20: Intro to Data Structures: Stacks, Queues, and Beyond
Book class:
Attributes: `title`, `author`, `isbn`, `checked_out` (bool), `due_date`, `genre` - Methods: `check_out(due_date)`, `return_book()`, `is_overdue()`, `__str__()`, `__eq__()` (by ISBN), `__repr__()` → Quiz: Object-Oriented Programming — Thinking in Objects
Book:
Title, author, ISBN - Whether it's currently available - Genre/category → Case Study: Modeling a Library System
built-in function
a tool that comes with Python, ready to use. Its job is simple: take whatever you give it and display it on the screen. → Chapter 2: Getting Started: Python, VS Code, and Your First Program

C

cache
a dictionary that stores recent results so they can be returned instantly: → Case Study: How Dictionaries Power the Modern Web
call stack
a stack of frames, one per active function call. Each frame holds the function's local variables, parameters, and the return address (where to resume when the function finishes). → Chapter 18: Recursion: Functions That Call Themselves
Capstone 1: The Personal Finance Tracker
a command-line application that tracks income and expenses, categorizes transactions, generates monthly reports with statistics, and exports data to CSV. This project emphasizes data structures, file I/O, OOP design, and error handling. → Part IX: Capstones
Capstone 2: The Trivia Game Engine
a multiplayer trivia game that loads questions from files or APIs, supports categories and difficulty levels, tracks scores with a persistent leaderboard, and allows custom question creation. This project emphasizes OOP, data persistence, API integration, and user experience. → Part IX: Capstones
Capstone 3: The Data Dashboard
a command-line data analysis tool that reads real-world datasets, performs statistical analysis, generates text-based visualizations, and produces formatted reports. This project emphasizes data processing, string formatting, file I/O, modules, and regular expressions. → Part IX: Capstones
capture group
they tell the regex engine "I want to remember this part separately." → Chapter 22: Regular Expressions: Pattern Matching Power
Categorize every transaction
reject uncategorized entries with a helpful error message. *(Chapter 11)* → Capstone Project 1: The Personal Finance Tracker
Ceremonies:
Sprint Planning -> Daily Standup -> Sprint Review -> Sprint Retrospective → Key Takeaways: Software Development Lifecycle
check the box that says "Add python.exe to PATH"
this is critical and the single most common source of problems when students skip it. → Appendix B: Environment Setup Guide
Choose the route
which states, which highways, what order 2. **Estimate travel time** — total driving hours, how to split across days 3. **Plan overnight stops** — find hotels or campgrounds, make reservations 4. **Budget the trip** — gas costs, food, lodging, activities 5. **Prepare the vehicle** — oil change, tire → Appendix G: Answers to Selected Exercises
Clarity
It's understandable to other humans (and to you in six months). A clever trick that saves one millisecond but takes twenty minutes to understand is usually a bad trade-off. → Chapter 17: Algorithms and Problem-Solving Strategies
code implementation block
a program you should type out and run yourself. → Chapter 2: Getting Started: Python, VS Code, and Your First Program
comments
lines that Python ignores completely. They exist solely for the humans reading the code. → Chapter 2: Getting Started: Python, VS Code, and Your First Program
commit
a permanent snapshot of your project at this moment in time. Let's break down what happened: → Chapter 25: Version Control with Git: Collaborating Like a Professional
commit hash
to this snapshot - The message `1 file changed, 22 insertions(+)` tells you what the commit contains → Chapter 25: Version Control with Git: Collaborating Like a Professional
Common causes and fixes:
**Permission error:** Use `python3 -m pip install --user package_name` or use a virtual environment (recommended). - **pip not found:** Use `python3 -m pip install package_name` instead. - **SSL certificate error:** Upgrade pip: `python3 -m pip install --upgrade pip` - **Package not found:** Check t → Appendix B: Environment Setup Guide
compose
you build complex behavior by combining simple functions. → Chapter 6: Functions: Writing Reusable Code
composition
building objects that *contain* other objects — rather than inheritance. → Chapter 15: Inheritance and Polymorphism: Building on What Exists
Computational thinking
decomposition, pattern recognition, abstraction, and algorithm design — is a problem-solving framework that extends far beyond programming. - Professional programmers spend most of their time reading, discussing, and debugging code — not just writing it. - CS fundamentals are durable: the concepts t → Chapter 1: Welcome to Computer Science: What Programmers Actually Do
Computer Architecture
How computers actually work at the hardware level. Binary numbers (Appendix C), memory, processors, instruction sets, and how your Python code eventually becomes electrical signals. → Chapter 27: What's Next: Pathways in Computer Science
Consider the site's size
a personal blog can handle far less traffic than Amazon → Chapter 24: Web Scraping and Automation
Constants are named in ALL_CAPS
`MILES_TO_KM`, `FEET_TO_METERS`. This follows PEP 8 convention and makes it clear these values don't change. 2. **We used f-string alignment** (`:<20` for left-align, `:>12` for right-align) to create a clean columnar layout. 3. **We used the thousands separator** (`:,`) for large numbers like feet → Case Study: Building a Unit Converter
constructor
it runs automatically every time you create a new object from this class. Its job is to set up the object's initial state. → Chapter 14: Object-Oriented Programming: Thinking in Objects
convoy effect
short processes get stuck behind long ones. → Case Study 2: How Operating Systems Use Queues
Correctness
It produces the right answer for *every* valid input, not just the ones you tested. This includes edge cases: empty lists, single elements, lists where every element is the same, negative numbers. → Chapter 17: Algorithms and Problem-Solving Strategies
Correctness:
Does the code do what the user story/requirement asks for? - Are there edge cases that aren't handled? - Could any inputs cause crashes or unexpected behavior? → Chapter 26: Software Development Lifecycle
Crypts of Pythonia
A text-based adventure game used as a running example for game design concepts. All room descriptions, items, and game mechanics are original creations. → Appendix H: Bibliography
Crypts of Pythonia (The Text Adventure)
A text-based adventure game that starts with a single if/else fork and grows into a full game with inventory management, save/load, character classes, procedural dungeon generation, and a quest system. This example makes abstract concepts tangible and fun. → How to Use This Book
CSS selectors
the same syntax used in web development to style elements. CSS selectors are often more concise for complex queries: → Chapter 24: Web Scraping and Automation
CSV export uses `extrasaction="ignore"`
if tasks have extra fields (like from the undo stack), the CSV writer silently ignores them instead of crashing. 2. **CSV import converts the `done` field** from a string (`"True"/"False"`) back to a boolean. CSV files store everything as strings — you always need to convert types when reading. 3. * → Chapter 21: Working with Data: CSV, JSON, and APIs
Custom sorting
sort tasks by priority, due date, creation date, or title using `key` functions and `lambda` 2. **Binary search** — search for a task by title in a sorted task list → Chapter 19: Searching and Sorting: Classic Algorithms

D

Daily motivational quote scraper
Fetch a random quote from `quotes.toscrape.com` and display it when the app starts, with caching so we don't re-scrape unnecessarily. 2. **Automated task report generation** -- Generate a formatted status report of all tasks and save it to a timestamped file. → Chapter 24: Web Scraping and Automation
Data Science:
Jupyter notebooks for exploratory analysis (interactive documents that mix code, text, and visualizations) - Anaconda distribution (bundles Python with hundreds of data science libraries) - Cloud-based notebooks (Google Colab, AWS SageMaker) - Database connections (SQL, NoSQL) → Case Study 2: Setting Up a Development Environment in the Real World
data transformation
There's **no state to maintain** between calls - The logic is a **pipeline** (input -> transform -> output) - Adding a class would just be wrapping a single function → Chapter 16: OOP Design: Patterns and Principles
Databases
How to store, organize, query, and manage large amounts of data efficiently. You used JSON files for persistence in Chapter 10. Databases are that idea taken to industrial scale, with query languages (SQL), indexing, transactions, and guarantees about data integrity. → Chapter 27: What's Next: Pathways in Computer Science
Decomposition
Breaking TaskFlow into modules (Ch 12): `models.py`, `storage.py`, `display.py`, `cli.py` > 2. **Pattern recognition** — Recognizing that linear search vs. binary search is a recurring pattern across problems (Ch 19) > 3. **Abstraction** — Using classes to hide internal complexity behind clean inter → Chapter 27: What's Next: Pathways in Computer Science
Deferred to Sprint 2:
Story 2 (Task Assignment) — depends on workspaces being implemented - Story 3 (Due Date Notifications) — independent but lower priority - Story 4 (Task Comments) — depends on workspaces → Example: User Stories for TaskFlow v3.0
dependencies
packages that `requests` itself needs to function → Case Study: How Open Source Packages Power the World
dependency tree
a hierarchy of packages that all need to be present for the top-level package to work. → Case Study: How Open Source Packages Power the World
Design:
Is the code in the right place? (Right module, right class, right function) - Are functions and classes doing one thing (Single Responsibility Principle)? - Is there unnecessary complexity? → Chapter 26: Software Development Lifecycle
dictionaries
mapping keys to values — and **sets** for membership testing and deduplication. You'll also learn how to choose the right data structure (list vs. dict vs. set vs. tuple) for a given problem. TaskFlow will upgrade from tuples to dictionaries, giving each task named fields instead of positional acces → Chapter 8: Lists and Tuples: Working with Sequences
Dictionaries and Sets
organize data by keys instead of position, enabling O(1) lookups. TaskFlow upgrades from tuples to dictionaries for named fields. → Key Takeaways: Lists and Tuples
Dictionary.
Need to check membership (is X in the collection)? **Set.** - Need ordered items that you will modify? **List.** - Need ordered items that should not change? **Tuple.** - Need key-value pairs with ordering? **Dictionary** (preserves insertion order since 3.7). → Common Student Struggles and Interventions
diff
it shows exactly what changed between two versions. Stage and commit: → Chapter 25: Version Control with Git: Collaborating Like a Professional
Difficulty Guide:
⭐ Foundational (5-10 min each) - ⭐⭐ Intermediate (10-20 min each) - ⭐⭐⭐ Challenging (20-40 min each) - ⭐⭐⭐⭐ Advanced/Research (40+ min each) → Exercises: Welcome to Computer Science
Divide and Conquer
The closest-pair problem has a famous O(n log n) divide-and-conquer solution. Brute force would be O(n²). 2. **Brute Force** — With only 8 items, there are 2⁸ = 256 subsets. Brute force checks them all easily. (For 80 items, you'd need dynamic programming — a topic for CS2.) 3. **Greedy** — Scheduli → Chapter 17: Algorithms and Problem-Solving Strategies
Do comment:
*Why* you made a particular choice (not *what* the code does) - Anything that would confuse someone seeing the code for the first time - High-level descriptions of what a section of code accomplishes → Chapter 2: Getting Started: Python, VS Code, and Your First Program
Doesn't crash on unexpected input
it tells the user what went wrong 2. **Doesn't lose data** — it saves progress before failing 3. **Gives actionable feedback** — "File 'grades.csv' not found in /home/user/data/" is useful; a raw traceback is not (for most users) 4. **Fails gracefully** — when it truly can't continue, it cleans up a → Chapter 11: Error Handling: When Things Go Wrong (and They Will)
Don't comment:
Every single line (this makes code *harder* to read, not easier) - Obvious things (`x = 5 # assign 5 to x`) - Instead of writing clear code (fix the code, don't explain the mess) → Chapter 2: Getting Started: Python, VS Code, and Your First Program
Downloads
Is it widely used? 2. **Maintenance** — When was the last update? 3. **Source code** — Can you read it? Is it on GitHub? 4. **Documentation** — Is it clear and current? 5. **License** — Is it compatible with your project? 6. **Dependencies** — How many does it pull in? → Key Takeaways: Libraries and Virtual Environments
Dr. Anika Patel
Biology researcher at a university, processing DNA sequence data. Her scenarios illustrate bioinformatics applications of Python. Dr. Patel's workflows are inspired by common bioinformatics tasks described in Cock et al.'s Biopython documentation and computational biology textbooks, but all specific → Appendix H: Bibliography
Dr. Patel's DNA Pipeline (Dr. Anika Patel)
A biology researcher processing thousands of DNA sequence files. From counting nucleotides to pattern matching to batch processing to querying bioinformatics APIs. Dr. Patel's story shows that CS skills amplify domain expertise in any field. → How to Use This Book

E

Efficiency
It doesn't waste time or memory. The key insight of this chapter is that efficiency isn't about absolute speed ("it takes 0.3 seconds") — it's about *how running time grows* as input grows. → Chapter 17: Algorithms and Problem-Solving Strategies
Elena Vasquez
Data analyst at a nonprofit organization. Appears throughout the textbook as the anchor example for real-world data processing, automation, and professional development. Elena's scenarios are composites of common data analyst workflows described in industry blogs and professional development resourc → Appendix H: Bibliography
Elena's Nonprofit Report (Elena Vasquez)
A data analyst at a nonprofit who spends four hours every week manually assembling a report from three different spreadsheets. Over the course of the book, she automates the entire pipeline. Elena's story demonstrates why programming matters outside of tech: automation frees people to do meaningful → How to Use This Book
encapsulation
hiding internal state behind a public interface. The `Stack` class wraps a list but only exposes stack operations. Users don't need to know (or care) that a list is used internally. They interact with a *concept*, not an implementation. → Chapter 20: Intro to Data Structures: Stacks, Queues, and Beyond
Error handling:
Wrap `requests.get()` in `try/except` to handle network errors. - Use `response.raise_for_status()` to catch HTTP errors (404, 500, etc.). - If a page fails, log the error and continue to the next page rather than crashing. - Validate extracted data (e.g., prices should be numeric). → Quiz: Web Scraping and Automation
escape characters
special sequences that start with a backslash (`\`). → Chapter 7: Strings: Text Processing and Manipulation
Ethical problems:
Likely violates the competitor's Terms of Service. - Could constitute unfair business practices or even be illegal under some jurisdictions' computer fraud laws. - The aggressive rate could degrade the competitor's site performance, affecting their legitimate customers. - Automated price undercuttin → Quiz: Web Scraping and Automation
ethics of scraping
`robots.txt`, Terms of Service, and the question of when scraping is responsible. You explored **automation beyond scraping** -- file organization, batch renaming, and report generation. You learned to **schedule scripts** with `cron`, Task Scheduler, and the `schedule` library. And you saw the **pi → Chapter 24: Web Scraping and Automation
Exception types to catch:
`ValueError` — for failed numeric conversions - `IndexError` — for rows with fewer fields than expected → Quiz: Error Handling

F

Fetch, Parse, Transform, Output
four stages, each with a clear responsibility. → Chapter 24: Web Scraping and Automation
file object
a Python object that represents a connection to a file on disk. → Chapter 10: File Input and Output: Persistent Data
filtered report
apply filters first, then generate the report on the filtered subset. *(Chapters 5, 6)* → Capstone Project 3: The Data Dashboard
First Edition
*An Open Educational Resource* → Introduction to Computer Science with Python
First-Come, First-Served (FCFS)
process tasks in the order they arrive. This is a queue. → Case Study 2: How Operating Systems Use Queues
Fixes:
Use `python3 my_script.py` instead of `./my_script.py`. - If you must run it directly: `chmod +x my_script.py` and add `#!/usr/bin/env python3` as the first line. → Appendix B: Environment Setup Guide
Focused
tests one behavior, not five 2. **Independent** — doesn't depend on other tests or shared state 3. **Readable** — the function name describes what's being tested 4. **Deterministic** — produces the same result every time 5. **Fast** — runs in milliseconds, not seconds → Chapter 13: Testing and Debugging: Writing Code You Can Trust
Follow the style guide
practitioner tone, second person, encouraging but direct 3. **Respect the citation honesty system:** - Tier 1: Only for sources you can verify exist - Tier 2: Attributed but unverified claims - Tier 3: Clearly labeled illustrative examples 4. **Maintain voice consistency** with the existing chapters → Contributing to Introduction to Computer Science with Python
Forgetting `r` prefix
`"\b"` is a backspace; `r"\b"` is a word boundary 2. **Using `re.match()` when you mean `re.search()`** — `match()` only checks the start 3. **Greedy matching between delimiters** — `"<.*>"` matches too much; use `"<.*?>"` 4. **Overly complex regex** — if a colleague can't read it in 30 seconds, sim → Key Takeaways: Regular Expressions
Forgetting `return`
function prints instead of returning, caller gets `None` 2. **Mutable default argument** — `def f(items=[])` shares the list across calls; use `None` instead 3. **Scope confusion** — assigning to a name inside a function creates a local, potentially shadowing a global → Key Takeaways: Functions — Writing Reusable Code
Forgetting `self`
every method needs it as the first parameter, every attribute access uses `self.` 2. **Mutable class attributes** — lists/dicts at the class level are shared between all instances; use `__init__` instead 3. **God classes** — split large classes into focused ones, each with a single responsibility → Key Takeaways: Object-Oriented Programming — Thinking in Objects
Forgetting `super().__init__()`
parent attributes never get set, causing `AttributeError` later 2. **Using inheritance when composition is appropriate** — a Stack is not a list 3. **Deep hierarchies** — keep to 2-3 levels; deeper trees are hard to debug 4. **Breaking Liskov** — subclasses should work everywhere their parent works → Key Takeaways: Inheritance and Polymorphism
function
but the function lives on a server thousands of miles away. When you log into a website with your Google account, that website calls a **function** on Google's servers. When you ask a chatbot a question, the chatbot calls a **function** in an AI system. → Case Study: How APIs Work — Functions All the Way Down

G

Game Development:
Game engines (Unity, Unreal, Godot) with built-in editors - Asset management tools (for sprites, models, audio) - Performance profilers - Platform-specific SDKs (iOS, Android, console) → Case Study 2: Setting Up a Development Environment in the Real World
Get user input
what kind of conversion, and what value? 2. **Convert the value** — apply the right formula 3. **Display the result** — formatted cleanly → Case Study: Building a Unit Converter
global
they're accessible throughout the module: → Chapter 6: Functions: Writing Reusable Code
god class
a class that tries to do everything, violating the single responsibility principle. → Quiz: Object-Oriented Programming — Thinking in Objects
Grade Calculator
student project that grows from simple to sophisticated 2. **Elena Vasquez** — nonprofit data analyst automating reports 3. **Crypts of Pythonia** — text adventure game 4. **Dr. Anika Patel** — biology researcher processing DNA data → Key Takeaways: Welcome to Computer Science
greedy
they match as much text as possible. → Chapter 22: Regular Expressions: Pattern Matching Power
greedy-choice property
where locally optimal choices lead to globally optimal solutions. Before using greedy, you need to convince yourself (or prove) that the property holds. → Chapter 17: Algorithms and Problem-Solving Strategies
Guidelines:
Use the most specific exception type (`ValueError`, not `Exception`) - Include the actual problematic value in the message - Raise early (in the function), catch late (in the caller) → Key Takeaways: Error Handling

H

hash function
a function that converts a key into an array index. This is exactly how Python's `dict` works behind the scenes. → Chapter 20: Intro to Data Structures: Stacks, Queues, and Beyond
Her approach:
She checks the newspaper's `robots.txt` — the archive section is allowed. - She reads the Terms of Service — academic research using publicly visible data is permitted. - She sets `time.sleep(3)` between requests (3 seconds — conservative). - She includes a User-Agent header: `"Maya-ClimateResearch/ → Case Study: Ethical Web Scraping — When It's OK and When It Crosses the Line
His approach:
He scrapes three pages per day (one per store) — minimal server impact. - He checks each store's `robots.txt` — product pages are allowed. - He doesn't redistribute the price data. - He uses the data only for his own purchasing decisions. → Case Study: Ethical Web Scraping — When It's OK and When It Crosses the Line
How it works:
Scan left to right. - `(` → push onto the stack (we'll need to match it later). - `)` → pop the stack (we're matching the most recent `(`). - If we try to pop an empty stack, there's an unmatched `)`. - After scanning, if the stack isn't empty, there are unmatched `(`s. → Case Study 1: Building a Bracket Matcher
How to stop an infinite loop:
Press `Ctrl+C` in the terminal. - In VS Code, click the trash can icon in the terminal panel. → Appendix D: FAQ and Troubleshooting

I

If you loved algorithms (Ch 17-20):
Solve problems on LeetCode, HackerRank, or Project Euler - Implement a data structure from scratch (linked list, binary tree, hash table) - Build a pathfinding visualizer → Chapter 27: What's Next: Pathways in Computer Science
If you loved Crypts of Pythonia (game-adjacent):
Expand the text adventure with new rooms, items, and quests - Build a different genre (roguelike, puzzle game, interactive fiction) - Learn Pygame and add graphics → Chapter 27: What's Next: Pathways in Computer Science
If you loved data and automation (Ch 7-10, 21-24):
Build a budget tracker that reads your bank's CSV exports - Create a script that monitors a website for changes and sends you alerts - Automate something tedious in your daily life (file organization, email filtering, data cleanup) → Chapter 27: What's Next: Pathways in Computer Science
If you loved OOP and design (Ch 14-16):
Build a card game with proper class hierarchies - Create a simulation (ecosystem, traffic, economics) - Redesign a system you use and think is poorly organized → Chapter 27: What's Next: Pathways in Computer Science
immediately erases all its content
before you've written a single byte. There is no undo. This is the file I/O equivalent of `rm` — it doesn't ask for confirmation. → Chapter 10: File Input and Output: Persistent Data
immutable
once created, their contents cannot be modified. Not a single character. Not a slice. Not at all. → Chapter 7: Strings: Text Processing and Manipulation
Implement these calculations yourself
do not import the `statistics` module or `numpy`. The point is to practice the algorithms. → Capstone Project 3: The Data Dashboard
In this chapter, you will learn to:
Explain what computer science is and why it's more than "learning to code" - Break down problems using the four pillars of computational thinking - Identify real career paths in CS beyond the Silicon Valley stereotype - Understand why fundamentals matter even when AI can write code for you → Chapter 1: Welcome to Computer Science: What Programmers Actually Do
in-place
they rearrange elements within the original list without allocating significant extra memory. → Chapter 19: Searching and Sorting: Classic Algorithms
Incrementally experiment
you can try variations of an expression one at a time, adjusting based on what you see, without editing and re-running a file. → Chapter 2 Quiz
indexing
building a lookup table that maps words to the pages that contain them. → Case Study: How Search Engines Use Loops — Crawling, Indexing, and Ranking
infinite loop
the program runs forever (or until you press Ctrl+C to kill it). → Chapter 5: Repetition: Loops and Iteration
insufficient questions
if the user selects a category/difficulty combination with fewer questions than rounds requested, inform them and adjust. *(Chapters 4, 11)* - The game must **never crash** from user input. Invalid menu selections, non-numeric input, and empty strings should all produce helpful messages. *(Chapter 1 → Capstone Project 2: The Trivia Game Engine
Interpreting your results:
**Mostly 3s and 4s:** You've built a strong foundation. You're ready for CS2, personal projects, and entry-level internships. The areas where you scored 2 are worth revisiting before moving on. - **Mix of 2s and 3s:** You've learned a lot but some concepts haven't fully solidified. That's normal — c → Chapter 27: What's Next: Pathways in Computer Science
Issue
someone reports a bug or proposes a feature 2. **Discussion** — the community discusses whether and how to address it 3. **Fork + Branch** — a contributor creates a branch to work on the solution 4. **Pull Request** — the work is submitted for review 5. **Review** — maintainers examine the code, tes → Case Study: How Open Source Projects Use Git
Iteration
the act of repeating a process — is one of those ideas that fundamentally changes how you think about problems. Before you understand loops, you think about tasks in terms of "how long would this take me?" After you understand loops, you think in terms of "can I describe the pattern of what needs to → Chapter 5: Repetition: Loops and Iteration

K

Key concepts:
`open()` creates a file object; the mode (`"r"`, `"w"`, `"a"`) determines what you can do with it. - Context managers (`with`) guarantee files are closed, even when errors occur. - Process large files line by line to keep memory usage constant. - `pathlib.Path` provides cross-platform path handling → Chapter 10: File Input and Output: Persistent Data
Key ideas:
A **stack** supports `push`, `pop`, and `peek`. It's used for undo systems, bracket matching, backtracking, and expression evaluation. Implement it with a Python list using `append()` and `pop()` for O(1) operations. - A **queue** supports `enqueue`, `dequeue`, and `front`. It's used for task schedu → Chapter 20: Intro to Data Structures: Stacks, Queues, and Beyond
Key patterns used:
**EAFP for file operations:** Try to open/read, catch specific exceptions - **Retry loops for input:** Keep asking until the user provides valid input - **Custom exceptions:** Domain-specific error classes (though in this simple version, they're defined for future use as TaskFlow grows) - **Top-leve → Chapter 11: Error Handling: When Things Go Wrong (and They Will)
keyword arguments
specifying the parameter name at the call site: → Chapter 6: Functions: Writing Reusable Code
Know the limits
string methods are often simpler and clearer for straightforward tasks → Chapter 22: Regular Expressions: Pattern Matching Power

L

last line first
it tells you the error type and a human-readable description. Then look at the line number to find *where* in your code the problem is. → Chapter 2: Getting Started: Python, VS Code, and Your First Program
Library class:
Attributes: `name`, `books` (list of Book objects), `patrons` (list or dict) - Methods: `add_book(book)`, `remove_book(isbn)`, `search(keyword)`, `check_out_book(isbn, patron, due_date)`, `return_book(isbn)`, `get_overdue()`, `__len__()`, `__str__()` → Quiz: Object-Oriented Programming — Thinking in Objects
it checks each element one by one. In this chapter, we'll implement that search ourselves, understand its cost, and then learn a dramatically faster alternative. → Chapter 19: Searching and Sorting: Classic Algorithms
list method
it only works on lists. → Chapter 19 Quiz
lists and tuples
mutable and immutable sequences. The indexing and slicing you learned here work identically on lists. The key new concept: mutability — what happens when sequences *can* be changed in place (the opposite of string immutability). → Key Takeaways: Strings — Text Processing and Manipulation
Loan:
Which book, which patron - Date borrowed, due date - Whether it's been returned → Case Study: Modeling a Library System
loops
the programming construct that lets you say "do this thing repeatedly" without writing the same code over and over. Loops are where programming goes from "neat parlor trick" to "genuinely powerful tool." Once you can tell a computer to repeat a task, you can process datasets that would take a human → Chapter 5: Repetition: Loops and Iteration

M

macOS:
Open Terminal and type `git --version`. If Git isn't installed, macOS will prompt you to install the Xcode Command Line Tools. Accept the prompt. - Alternatively, install via Homebrew: `brew install git` → Chapter 25: Version Control with Git: Collaborating Like a Professional
metacharacters
characters with special meaning that let you describe *classes* of strings rather than one specific string. → Chapter 22: Regular Expressions: Pattern Matching Power
Method Resolution Order (MRO)
a specific algorithm (called C3 linearization) that determines the order in which Python searches for methods. You can inspect it: → Chapter 15: Inheritance and Polymorphism: Building on What Exists
Missing base case
leads to `RecursionError` 2. **Base case that's never reached** -- recursive step doesn't make the problem smaller 3. **Tree recursion without memoization** -- exponential time (Fibonacci is the classic example) 4. **Using recursion when iteration is simpler** -- e.g., summing 1 to n → Key Takeaways: Recursion
Missing entries that should be added:
`__pycache__/` — compiled bytecode directories - `*.py[cod]` — compiled Python files (`.pyc`, `.pyo`, `.pyd`) - `.pytest_cache/` — if using pytest - `.coverage` and `htmlcov/` — if using coverage testing - IDE settings like `.vscode/` or `.idea/` - OS files like `.DS_Store` or `Thumbs.db` → Quiz: Version Control with Git
mixins
small, focused classes that add a single capability (like `Flyable` and `Swimmable` above). Keep these guidelines in mind: → Chapter 15: Inheritance and Polymorphism: Building on What Exists
mode
what you intend to do with the file: → Chapter 10: File Input and Output: Persistent Data
modules and packages
splitting a growing program like TaskFlow into separate files that can be imported and reused. Then in Chapter 13, you'll combine error handling with **testing and debugging** to write code that you can *prove* works correctly. → Chapter 11: Error Handling: When Things Go Wrong (and They Will)
monorepo
a single, massive repository containing code for hundreds of services. This creates a unique dependency management challenge. → Case Study 1: Dependency Management in Production
multilevel feedback queues
the algorithm actually used by most modern operating systems. A process that uses its entire quantum gets moved to a lower-priority queue, while a process that finishes early stays at a higher priority. This automatically rewards interactive processes. → Case Study 2: How Operating Systems Use Queues
multiple inheritance
a class can inherit from more than one parent: → Chapter 15: Inheritance and Polymorphism: Building on What Exists
mutable
you can change them after creation. → Chapter 9: Dictionaries and Sets: Organizing Data
mutation testing (mutmut)
Search for "mutmut Python mutation testing" (Tier 2) Mutation testing works by introducing small changes (mutations) into your code and checking whether your tests catch them. If a mutation doesn't cause any test to fail, your tests have a gap. It's a way to test your tests. → Further Reading: Testing and Debugging

N

name mangling
Python internally renames it to `_BankAccount__balance`. You *can* still access it via `account._BankAccount__balance`, but the ugly name screams "you shouldn't be doing this." The purpose is to prevent *accidental* access, not to enforce a security boundary. → Chapter 14: Object-Oriented Programming: Thinking in Objects
name tags
when `age` is reassigned, the old value isn't "changed"; the name `age` is pointed to a new integer object. This is why `age` reflects the latest input each time the condition is checked. → Chapter 5: Repetition: Loops and Iteration
nested categories
categories that contain subcategories — and a **recursive search** that finds tasks at any depth. → Chapter 18: Recursion: Functions That Call Themselves
Networking
How computers communicate with each other. You used APIs and HTTP requests in Chapter 21. Networking courses explain the protocols underneath: TCP/IP, DNS, routing, sockets, and how the internet actually works. → Chapter 27: What's Next: Pathways in Computer Science
No menu or choices
the user can't pick which conversion to run. (Chapter 4: conditionals) - **No looping** — the program runs once and exits. (Chapter 5: loops) - **No error handling** — entering "abc" instead of a number crashes the program. (Chapter 11: error handling) - **No reverse conversions** — we hardcoded the → Case Study: Building a Unit Converter
No test isolation
if the second assertion fails, the third and fourth never run. With separate test functions, all tests run independently. → Quiz: Testing and Debugging
Not correct
it's missing a base case. Without one, it will recurse forever (and raise `RecursionError`). Even if it had a base case, calling `total` with a negative number or zero would also be problematic. → Quiz: Recursion
NP-hard
a class of problems for which no known algorithm can find the exact solution in polynomial time (like O(n²) or O(n³)). For NP-hard problems, the practical approach is usually: → Case Study: The Traveling Salesperson — When Good Enough Is Good Enough

O

O(1)
by name | **Instant** | **Named fields** | **Comprehension** | → Case Study: Building a Contact Book
O(n)
every existing element must shift right by one position. - c) **O(1)** average — hash table lookup. - d) **O(n)** worst case — must scan through the entire list. → Quiz: Algorithms and Problem-Solving Strategies
O(n²)
the most dominant term dictates the overall growth. → Chapter 17: Algorithms and Problem-Solving Strategies
OOP for Student records:
Pros: Each student naturally bundles name, grades, and major. Methods like `calculate_gpa()` belong with the data. If you process thousands of students, each object manages its own state cleanly. → Quiz: Object-Oriented Programming — Thinking in Objects
Operating Systems
How computers manage their resources: memory, processors, files, and processes. You've been using an operating system every time you ran a Python script. An OS course explains the machinery underneath — scheduling, virtual memory, file systems, and concurrency. → Chapter 27: What's Next: Pathways in Computer Science
OR
at least one must be true: → Appendix C: Mathematical Foundations

P

PASS
`3 * 4 == 12` is True - `test_multiply_by_zero`: **PASS** — `5 * 0 == 0` is True - `test_multiply_strings`: **PASS** — `"ha" * 3 == "hahaha"` is True (Python string repetition) - `test_multiply_negative`: **FAIL** — `(-2) * 3 == -6`, not `6`. The assertion `assert -6 == 6` fails. → Quiz: Testing and Debugging
Patron:
Name, library card number - List of current loans - Contact email → Case Study: Modeling a Library System
Personal projects
Build things you care about using concepts from the course 2. **Open source** — Start small (documentation, tests, error messages) and grow 3. **GitHub profile** — Pin quality projects with clear READMEs; consistency over quantity 4. **Competitions** — Advent of Code, LeetCode, hackathons, Project E → Key Takeaways: What's Next — Pathways in Computer Science
polymorphism
different objects responding to the same method call in their own way (Chapter 15 explores this in depth). → Case Study: How OOP Powers Video Games
priority override
it bypasses the normal cycle entirely. This is a common pattern: check for exceptional conditions first, then handle the normal flow. → Case Study: How Conditional Logic Powers Everyday Technology
Procedural for the report generation:
Pros: Calculating class averages and producing a report are one-time operations on a collection. A function like `generate_report(students)` is simpler than a `ReportGenerator` class for a one-off task. → Quiz: Object-Oriented Programming — Thinking in Objects
prompt
the text that tells the user what to type. Always include a trailing space in your prompt so the user's text doesn't run into the question. → Chapter 2: Getting Started: Python, VS Code, and Your First Program
pure function
it takes input as parameters and returns output as a return value. No `input()`, no `print()`, no side effects. Testing it is trivial: → Chapter 13: Testing and Debugging: Writing Code You Can Trust
PyConUS and regional PyCons
The annual Python conference is welcoming to beginners and often has student pricing or scholarships. - **Local hackathons** — Check your university, local tech companies, or MLH (Major League Hacking) for events. - **Study groups** — Form one with classmates. Working through CS2 together is dramati → Chapter 27: What's Next: Pathways in Computer Science
pytest
a third-party framework that's simpler, more powerful, and more readable. We'll use pytest throughout this chapter. → Chapter 13: Testing and Debugging: Writing Code You Can Trust
Python
open source since 1991, developed by a global community of thousands - **VS Code** — Microsoft's editor, open-sourced in 2015, with over 30,000 community-contributed extensions - **Git** — created by Linus Torvalds in 2005, maintained by a global volunteer community - **pytest** — the testing framew → Case Study: The Open Source World — How to Contribute and Grow
Python Documentation
[docs.python.org/3/](https://docs.python.org/3/) The official documentation. Learn to read it — it's one of the best language references in existence. Start with the Tutorial and Library Reference sections. → Appendix H: Bibliography
Python Package Index (PyPI)
a repository of over 500,000 open-source Python packages — and installs them into your current environment. → Chapter 23: Libraries and Virtual Environments
Python standard library
a collection of pre-built tools that ships with every Python installation. You'll also learn how to install **third-party packages** from the broader Python ecosystem. → Chapter 12: Modules, Packages, and the Python Ecosystem
Python's Timsort
the best of both worlds; use it → Chapter 19: Searching and Sorting: Classic Algorithms

Q

Quality over quantity
three well-documented projects beat thirty bare repositories - **Your TaskFlow project** — you built this across 27 chapters. Clean it up, write a thorough README, and pin it. It demonstrates functions, OOP, file I/O, testing, error handling, and Git — exactly the skills employers look for in a CS1 → Chapter 27: What's Next: Pathways in Computer Science
Queue
tickets should be processed in FIFO order to be fair; the first customer to submit should be served first. → Quiz: Stacks, Queues, and Beyond
Quotes to Scrape
http://quotes.toscrape.com (used in this chapter) - **Books to Scrape** — http://books.toscrape.com - **HTTPBin** — https://httpbin.org (for testing HTTP requests) - **The Scrapinghub Blog's list of practice sites** — search "web scraping sandbox" for additional options → Further Reading: Web Scraping and Automation

R

ranking
and ranking is another loop with an accumulator. → Case Study: How Search Engines Use Loops — Crawling, Indexing, and Ranking
raw string
one where backslashes are treated as literal characters, not escape sequences. → Chapter 22: Regular Expressions: Pattern Matching Power
Read the error message
Python traceback tells you the file, line, and exception type 2. **Print debugging** — add `print()` calls to see intermediate values 3. **Rubber duck debugging** — explain the code line by line out loud 4. **Binary search debugging** — check the midpoint, narrow to the half that's broken 5. **VS Co → Key Takeaways: Testing and Debugging
Readability:
Are names clear and descriptive? - Would someone unfamiliar with this code understand it? - Are there comments where the code isn't self-explanatory? → Chapter 26: Software Development Lifecycle
Reading code is as important as writing it
most professional developers spend more time reading code than writing it 3. **Errors are not failures, they are information** — debugging is the skill, not the obstacle 4. **Many ways to solve every problem** — learning to evaluate trade-offs separates beginners from professionals 5. **The tools yo → Introduction to Computer Science with Python: Computational Thinking for the AI Era
Real Python
[realpython.com](https://realpython.com/) High-quality Python tutorials, articles, and video courses. Covers everything from beginner to advanced topics. Many articles are freely accessible. → Appendix H: Bibliography
Real-world examples:
Server log files (Apache, Nginx) - Configuration files in older Unix tools - README files, changelogs - Output from command-line tools → Case Study: Data Formats in the Wild
`StudentRegistry` — student CRUD operations - `TeacherRegistry` — teacher CRUD operations - `GradeBook` — grades, GPA, report cards - `Scheduler` — class scheduling, room booking - `BillingSystem` — tuition and payments - `CommunicationService` — newsletters, notifications - `SupplyManager` — supply → Quiz: OOP Design: Patterns and Principles
the keyword search feature should support regex patterns (e.g., searching for `\d{3}-\d{4}` to find phone number patterns). *(Chapter 22)* - Use regex for **date detection** during column type classification (recognize patterns like `2026-03-14`, `03/14/2026`, `March 14, 2026`). *(Chapter 22)* - Use → Capstone Project 3: The Data Dashboard
regression
something that used to work stopped working because of an unrelated change. How does a test suite protect against regressions? What would have happened without one? → Case Study: The Test That Saved a Launch
regression test suite
tests that catch *regressions* (things that used to work but now don't) when you modify code. → Chapter 13: Testing and Debugging: Writing Code You Can Trust
regular expression
regex for short. A regex is a mini-language for describing text patterns. Instead of saying "find the exact string `555-867-5309`," you say "find three digits, then a separator, then three digits, then a separator, then four digits." The regex engine handles the rest. → Chapter 22: Regular Expressions: Pattern Matching Power
relative import
it says "import from `calculations.py` which is in the same directory as me." This is different from an **absolute import** like `from grading.calculations import ...`, which uses the full package path. → Chapter 12: Modules, Packages, and the Python Ecosystem
Removing items
**Updating quantities** - **Calculating totals** - **Applying discounts** (filtering and transforming) → Case Study: How Playlists, Shopping Carts, and Feeds Use Lists
resource cleanup
closing files, releasing database connections, or restoring state. Even if an unhandled exception propagates up, `finally` runs first. → Chapter 11: Error Handling: When Things Go Wrong (and They Will)
Respond to code review
maintainers will review your changes and may request modifications 8. **Celebrate** when your PR is merged → Case Study: The Open Source World — How to Contribute and Grow
Responsible scraping:
Check `robots.txt` before starting. - Add `time.sleep(1)` or more between page requests. - Use a descriptive `User-Agent` header. - Limit the total number of requests per session. - Consider if the site has an API instead. → Quiz: Web Scraping and Automation
Rule of thumb:
If your data looks like a spreadsheet (rows and columns, all the same fields), use CSV. - If your data is nested, has varying fields per record, or needs to round-trip through a web API, use JSON. - If your data is just human-readable notes or logs, plain text is fine. → Chapter 10: File Input and Output: Persistent Data

S

safety
when you pass a string to a function, you can be certain the function cannot alter your original string, eliminating an entire category of bugs. Other valid benefits include: strings can be used as dictionary keys (hashability), memory optimization through string interning, and thread safety. → Quiz: Strings — Text Processing and Manipulation
Scoring:
**5/5:** You are completely ready. Math will not be a barrier. - **3-4/5:** You are fine. Brush up on order of operations (PEMDAS) and basic algebra if you want extra confidence. Appendix C covers the math foundations you will need. - **0-2/5:** Consider reviewing basic algebra before or alongside C → Prerequisites and Self-Assessment
Search tasks by keyword
case-insensitive using `lower()` 2. **Formatted task display** — aligned columns using f-string formatting → Chapter 7: Strings: Text Processing and Manipulation
searching
finding a specific item in a collection — and **sorting** — putting items in order. → Chapter 19: Searching and Sorting: Classic Algorithms
Select columns
display only a subset of columns chosen by the user. *(Chapter 8)* → Capstone Project 3: The Data Dashboard
Selected Stories:
Story 1 (Team Workspaces) — core feature, everything else depends on it - Story 5 (Task Templates) — small, independent, quick win for user value → Example: User Stories for TaskFlow v3.0
sequence
and in Python, many things are sequences. We'll explore lists and tuples fully in Chapter 8, but here's a preview of how `for` works with them. → Chapter 5: Repetition: Loops and Iteration
shallow copies
they copy the list itself but not the objects *inside* it. For nested lists, this matters: → Chapter 8: Lists and Tuples: Working with Sequences
skipped
we already found a match 4. Continue to `print` → Chapter 4: Making Decisions: Conditionals and Boolean Logic
Sofia, Marcus, and Priya
CS professionals featured in the career profiles of Chapter 1. Composite characters representing common career paths in software engineering, data science, and cybersecurity. → Appendix H: Bibliography
Software Engineering
How to build large software systems in teams. Chapter 26 introduced you to the software development lifecycle. A full software engineering course goes deeper into requirements analysis, architecture, design patterns, continuous integration, and project management. → Chapter 27: What's Next: Pathways in Computer Science
special methods
also called **dunder methods** (short for "double underscore") — that let your objects integrate with Python's built-in operations. You've already seen `__init__`. Here are the most important ones. → Chapter 14: Object-Oriented Programming: Thinking in Objects
stable
equal elements maintain their original relative order. This combination of properties, plus its C implementation, makes it nearly impossible to beat in practice. → Chapter 19: Searching and Sorting: Classic Algorithms
Stack
browser tabs follow LIFO: you typically close the most recently opened tab first, and "close" undoes the last "open." → Quiz: Stacks, Queues, and Beyond
stack overflow
when the call stack runs out of memory. Every recursive call allocates a new stack frame, and there's only so much memory available. → Chapter 18: Recursion: Functions That Call Themselves
standard library
often described with the phrase "batteries included." These modules are already installed. No `pip install` needed. You just `import` them. → Chapter 12: Modules, Packages, and the Python Ecosystem
Stay procedural when:
You're writing stateless utility functions (verbs: calculate, parse, convert) - You have a simple input-to-output transformation - No instances or shared state are needed → Key Takeaways: Object-Oriented Programming — Thinking in Objects
Strengths:
Universal — every tool, every language, every OS can read it - Human-readable with no special tools - Append-friendly (great for logs) → Case Study: Data Formats in the Wild
string
a sequence of characters. The quotes tell Python "this is text, not a command." You can use single quotes or double quotes — Python treats them identically: → Chapter 2: Getting Started: Python, VS Code, and Your First Program
strings
Python's text processing powerhouse. You'll learn to slice, search, transform, and format text data. The string methods you learn there are among the most frequently used tools in real-world Python code. And now that you understand functions, you'll be able to build string-processing *functions* tha → Chapter 6: Functions: Writing Reusable Code
Strings are immutable
you can't change them in place, only create new ones - **String methods** like `split()`, `join()`, `strip()`, `replace()`, `find()`, `upper()`, and `lower()` are your daily tools for text processing - **Inspection methods** like `isdigit()`, `isalpha()`, and `isalnum()` validate input - **f-string → Chapter 7: Strings: Text Processing and Manipulation
Style:
Does the code follow the project's conventions? - Is formatting consistent? → Chapter 26: Software Development Lifecycle
Syntax error
Python catches the missing `)` before running. > 2. **Runtime error** — `IndexError` occurs when the list index is out of range. > 3. **Logic error** — the program runs fine but the tip is 10x too small. No exception is raised. > → Chapter 11: Error Handling: When Things Go Wrong (and They Will)
system Python
the Python installation that ships with your operating system (or the one you installed in Chapter 2). Every project on your computer shares that single installation, including every package you've ever installed. → Chapter 23: Libraries and Virtual Environments
Systems/DevOps:
Multiple terminal sessions (often using a tool called tmux) - SSH connections to remote servers - Infrastructure-as-code tools (Terraform, Ansible) - Monitoring dashboards - Heavy use of scripting (Bash, Python) → Case Study 2: Setting Up a Development Environment in the Real World

T

tail recursion
a special form where the recursive call is the very last thing the function does: → Chapter 18: Recursion: Functions That Call Themselves
TaskFlow
a command-line task and project manager. It starts simple: in Chapter 2, it just says hello. By Chapter 27, it's a full-featured productivity tool with: → Chapter 1: Welcome to Computer Science: What Programmers Actually Do
TaskFlow CLI
The progressive project built across all 27 chapters. A command-line task manager that evolves from a simple to-do list to a full-featured productivity tool. Original design. → Appendix H: Bibliography
Technical problems:
30-second intervals is extremely aggressive. The friend's IP will likely get blocked quickly. Even 1-minute intervals are considered fast for most sites. - No mention of `robots.txt` compliance. - Price pages often require JavaScript rendering, so `requests + Beautiful Soup` may not work — might nee → Quiz: Web Scraping and Automation
Testing:
Are there tests for the new functionality? - Do the tests cover edge cases? - Do existing tests still pass? → Chapter 26: Software Development Lifecycle
Tests built-in Python features, not your own code
these tests verify that Python's `+`, `upper()`, `append()`, and dict indexing work. You should be testing *your* functions, not the language itself. → Quiz: Testing and Debugging
Tests multiple unrelated things in one function
if the addition assertion fails, you don't know if the string, list, or dict tests would also fail. Each test should verify one behavior. → Quiz: Testing and Debugging
The bug is in step 6
the grouping logic. > > Three checks instead of eight. For larger codebases, the savings are dramatic — binary search narrows the problem space by half with each check. → Chapter 13: Testing and Debugging: Writing Code You Can Trust
The complications:
Three of the fifteen companies' Terms of Service state: "You may not use automated means to access this site." - Two companies send her cease-and-desist letters asking her to stop scraping their listings. - One company offers her an API with a commercial license for $500/month. → Case Study: Ethical Web Scraping — When It's OK and When It Crosses the Line
The Grade Calculator
Your first real program. Starts as simple averaging and evolves into a weighted grade system with letter grades, GPA computation, CSV export, and eventually an OOP refactor. This example appears in nearly every chapter and grounds abstract concepts in something immediately relatable. → How to Use This Book
The problems multiply:
The platform's `robots.txt` explicitly disallows scraping user profiles. - The Terms of Service prohibit automated data collection. - The scraped data includes personal information — even though profiles are "public," users didn't consent to bulk collection and aggregation. - Derek's database makes → Case Study: Ethical Web Scraping — When It's OK and When It Crosses the Line
The Three Structures:
`if`: Do something only when a condition is true - `if-else`: Choose between two paths - `if-elif-else`: Choose among multiple paths (first match wins) → Chapter 4: Making Decisions: Conditionals and Boolean Logic
This textbook
every chapter, every example, every exercise - **Python's official documentation** — `docs.python.org` is a professional resource, not a cheat sheet - **Your own previous code** — including TaskFlow and chapter exercises - **Stack Overflow and similar sites** — for specific syntax questions ("how do → Capstone Rubric: Detailed Assessment Criteria
traceback
a detailed report showing exactly what went wrong and where. New programmers often find tracebacks intimidating, but they're actually Python trying to help you. Learning to read them is one of the highest-leverage debugging skills you can develop. → Chapter 11: Error Handling: When Things Go Wrong (and They Will)
transitive dependencies
packages that your packages need. pip resolves and installs the entire dependency tree automatically. → Chapter 23: Libraries and Virtual Environments
Treat the secret as compromised immediately
change the password or rotate the API key 2. Remove the file from tracking: ```bash git rm --cached secrets.env echo "secrets.env" >> .gitignore git add .gitignore git commit -m "Remove secrets.env from tracking" git push ``` 3. For truly sensitive data, look into `git filter-branch` or the `BFG Rep → Case Study: The Git Disaster Recovery Guide
Tree
family relationships are hierarchical (parent-child), which is exactly what trees model. → Quiz: Stacks, Queues, and Beyond
true division
it always gives you a float, even when the result is a whole number. - `//` is **floor division** — it drops the decimal part (rounds toward negative infinity). → Chapter 3: Variables, Types, and Expressions: The Building Blocks
Tuples become lists
the distinction is lost | → Chapter 10: File Input and Output: Persistent Data
type
a category that determines what kind of data it is and what operations you can perform on it. Python has many types, but you'll work with four fundamental ones constantly. → Chapter 3: Variables, Types, and Expressions: The Building Blocks

U

untracked
Git knows it exists but isn't recording changes to it. We need to explicitly tell Git to start tracking it. → Chapter 25: Version Control with Git: Collaborating Like a Professional
Use iteration when:
The problem is straightforward repetition or accumulation - Deep recursion would exceed Python's stack limit - Performance is critical and the recursive overhead matters → Key Takeaways: Recursion
Use OOP when:
You're modeling "things" with identity, state, and behavior (nouns: Student, Task, Room) - Multiple related data items belong together - You need multiple instances of the same concept - State changes over time and needs tracking → Key Takeaways: Object-Oriented Programming — Thinking in Objects
Use recursion when:
The data is naturally recursive (directories, trees, nested structures) - The problem decomposes into smaller self-similar sub-problems - A recursive solution is significantly clearer than an iterative one → Key Takeaways: Recursion
user stories
short, plain-language descriptions of what a user needs to accomplish. The standard format is: → Chapter 26: Software Development Lifecycle

V

Vague name
`test_everything` gives no information about what's being verified. Good names describe the specific behavior: `test_add_returns_sum`, `test_upper_converts_lowercase`. → Quiz: Testing and Debugging
Validate every field
reject empty questions, reject questions with fewer than 2 choices, ensure the correct answer matches one of the choices. *(Chapter 11)* - **Save new questions** to the question bank file immediately. *(Chapter 10)* → Capstone Project 2: The Trivia Game Engine
version control with Git
how to track your code's history, experiment fearlessly on branches, and collaborate with other developers. You'll initialize a Git repository for TaskFlow and learn the workflow that powers open-source development worldwide. → Chapter 24: Web Scraping and Automation
virtual environment
an isolated Python installation with its own set of installed packages. This prevents "dependency hell," where Project A needs version 1.0 of a library and Project B needs version 2.0 of the same library. Virtual environments keep each project's dependencies separate. You'll learn about virtual envi → Case Study 2: Setting Up a Development Environment in the Real World
virtual environments
isolated Python installations for each project. In real work, you'll create a virtual environment for every project to avoid version conflicts between different projects' dependencies. For now, `pip install` in your global Python installation is fine for learning. → Chapter 12: Modules, Packages, and the Python Ecosystem
Visual Studio Code (VS Code)
a free, open-source editor made by Microsoft that's become the most popular editor among professional developers. → Chapter 2: Getting Started: Python, VS Code, and Your First Program

W

Walkthrough:
**Lines 1-5:** Print a visual banner with a horizontal rule made from `=` signs. - **Lines 7-9:** Three `input()` calls, each storing the user's response in a variable. The variable names (`name`, `city`, `language`) describe what they hold — a habit you should build from day one. - **Lines 11-14:** → Chapter 2: Getting Started: Python, VS Code, and Your First Program
We added context
the reference temperatures help the user interpret the result. Is 22°C hot or cold? The reference table makes it clear. → Case Study: Building a Unit Converter
Weaknesses:
No structure — parsing requires custom code - No schema validation - Not suitable for complex data → Case Study: Data Formats in the Wild
Web Development:
VS Code with extensions for HTML, CSS, JavaScript - Node.js runtime alongside Python - Browser developer tools for debugging - Docker for running databases and services locally - Framework-specific tools (Django, Flask, FastAPI) → Case Study 2: Setting Up a Development Environment in the Real World
What didn't go well?
Story 4 almost got dropped because of underestimation on Story 1 - The integration bug (promo code applied to wrong total) should have been caught earlier → Case Study 1: How a Real Team Builds Software — A Sprint from Start to Finish
What went well?
Code review caught two bugs before they reached users - Splitting the promo code story was the right call — 2c would have been too much - Daily standups surfaced the rate limit issue quickly → Case Study 1: How a Real Team Builds Software — A Sprint from Start to Finish
What will we change?
Add integration testing to the Definition of Done for every story, not just at the end of the sprint - When estimating, add a buffer for "investigation time" on stories that involve third-party APIs → Case Study 1: How a Real Team Builds Software — A Sprint from Start to Finish
What's new in v0.2:
Variables to store data (`user_name`, `task_name`, `task_created`) - Type awareness — `datetime.now()` returns a datetime object, which we convert to a formatted string - f-strings for clean output formatting - String repetition (`"=" * 40`) for visual structure → Chapter 3: Variables, Types, and Expressions: The Building Blocks
Where it could become problematic:
If he scaled it to check prices every 30 seconds — that's aggressive and could trigger IP blocks. - If he built a public price comparison website with the data — he'd be redistributing commercial data, potentially violating Terms of Service. - If one of the stores' Terms of Service explicitly prohib → Case Study: Ethical Web Scraping — When It's OK and When It Crosses the Line
widget
a visual element that can be drawn on screen. Buttons, text fields, labels, checkboxes, panels — they're all widgets. And they all share common properties: a position, a size, visibility, and the ability to draw themselves. → Case Study: How GUI Frameworks Use Inheritance
wildcard pattern
it matches anything that wasn't caught by a previous case. It's like the `else` in an `if-elif-else` chain. → Chapter 4: Making Decisions: Conditionals and Boolean Logic
Windows:
Download the installer from [https://git-scm.com/downloads](https://git-scm.com/downloads) - Run the installer and accept the default options (they're sensible) - After installation, open a new terminal and verify: → Chapter 25: Version Control with Git: Collaborating Like a Professional
Working Directory
your actual files on disk, in the state you can see and edit 2. **Staging Area** — a selection of changes you've chosen to include in the next commit 3. **Repository** — the permanent history of all commits (stored in `.git`) → Chapter 25: Version Control with Git: Collaborating Like a Professional