Unit 08 · overview

Unit 8: Strings, Lists & Dictionaries

The moment your program needs more than a few isolated values, data structure becomes an architecture decision.

A string is not “basically a list.” A list and dictionary can both hold many values, but they answer different questions. Mutation can be intentional or can surprise you when two names refer to the same object.

Choose a structure because of the operations

This Unit works with string operations, list indexing/slicing, iteration, append/remove/update behavior, dictionary keys and values, nested structures, and mutation.

The question is never just “which syntax do I remember?” Ask instead:

Do order and position matter?
Do I need lookup by a meaningful key?
Can values repeat?
Will the structure change after creation?
What does another function need to know about its shape?

You will build structured records and deliberately test mutation so you can see when state changes in place.

Defend one data choice

Your evidence is not a worksheet listing definitions. Pick one part of your project and defend why a string, list, or dictionary fits the required operations better than the alternatives. Include one small code example and one mutation/aliasing observation that affected your reasoning.

Good data structure choices reduce hidden assumptions in later code.