Part III: Data
Programs are machines that transform data. They read it, reshape it, search it, combine it, and write it somewhere new. Everything you have learned so far --- variables, conditionals, loops, functions --- has been building toward this: the ability to work with real data, in all its messy, structured, and unstructured glory.
Part III is where you power up.
What This Part Covers
Chapter 7: Strings takes you deep into text processing. You already know strings exist; now you will learn to slice them, search them, split them apart, and stitch them back together. Text is everywhere in real-world data --- names, emails, DNA sequences, log files, chat messages --- and mastering string manipulation is one of the most immediately practical skills in programming.
Chapter 8: Lists and Tuples introduces Python's most versatile data structures. Lists let you store collections of anything --- numbers, strings, even other lists --- and manipulate them with powerful built-in methods. You will learn list comprehensions, one of Python's most elegant features, and confront the critical concept of mutability and aliasing: after b = a, the names a and b point to the same list, so appending through b changes what you see through a. No copy was ever made.
Chapter 9: Dictionaries and Sets gives you data structures built for speed. To check whether something is in a list, Python has to scan it item by item; a dictionary or set jumps almost straight to the answer, however large it grows. Dictionaries map keys to values, and sets let you test membership, eliminate duplicates, and compute unions and intersections in a single line. Choosing the right data structure for the job is one of the marks of a thoughtful programmer, and this chapter teaches you how.
Chapter 10: File I/O makes your programs persistent. Until now, every program you have written forgets everything the moment it stops running. This chapter changes that. You will read from text files, write CSV reports, save and load JSON data, and handle file paths cleanly with pathlib. Your programs will finally outlive their execution.
Why This Matters
In professional software development, choosing and manipulating data structures is easily half the job. When a senior developer reviews your code, they are not looking at whether your loops are clever. They are looking at whether you picked the right data structure, whether you handle edge cases in your text processing, and whether your data persists reliably. The skills in Part III are the skills that separate "I can write a script" from "I can build software."
What You Will Be Able to Do
By the end of Part III, you will be able to:
- Process, search, validate, and format text data using string methods
- Store and manipulate collections using lists, tuples, dictionaries, and sets
- Choose the right data structure for a given problem and explain your reasoning
- Write list and dictionary comprehensions for concise data transformations
- Read and write files in text, CSV, and JSON formats
- Build programs that save state between sessions
How the Chapters Connect
The core material in Chapters 7, 8, and 9 depends on functions (Chapter 6) rather than on each other, so you can dip into them in a different order if you need to --- but the TaskFlow checkpoints build on one another (v0.8 upgrades the tuples from v0.7), so reading them in sequence is the smoother path. They also form a natural progression from simple sequences (strings) to flexible sequences (lists) to associative mappings (dictionaries). Chapter 10 then ties them together: you will read strings from files, store them in lists and dictionaries, and write results back to disk. By the end, you will have a complete data pipeline in miniature.
Your Progressive Project: TaskFlow
TaskFlow evolves rapidly in Part III. You will add keyword search with case-insensitive matching and formatted display (v0.6, Chapter 7). You will restructure tasks as a list of tuples with sorting and bulk operations (v0.7, Chapter 8). You will upgrade to dictionaries with fields for name, priority, category, and creation date, plus category filtering (v0.8, Chapter 9). And in Chapter 10, you will give TaskFlow the ability to save tasks to a JSON file and reload them on startup --- the moment your application becomes genuinely useful, because it remembers (v0.9).
Data is what programs operate on. After Part III, you will know how to operate on it well.