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 the most common data type in the real world --- 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: the fact that two variable names can point to the same list, and changing one changes the other.

Chapter 9: Dictionaries and Sets gives you data structures built for speed. Dictionaries map keys to values with near-instant lookup, and sets let you test membership, eliminate duplicates, and perform set operations in ways that would be painfully slow with lists. 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

Chapters 7, 8, and 9 can be studied in any order --- they all depend on functions (Chapter 6) but not on each other. That said, they build 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.

Chapters in This Part