3
Collections
Real programs handle many values at once. Today you learn Python's four core containers and — just as important — how to pick the right one.
Lessons
- 1 Lists Ordered, changeable collections — how to build them, index them, slice them, sort them, and copy them safely. lists collections sorting
- 2 Tuples & Unpacking Fixed collections, multiple return values, and the assignment trick that makes Python code look like Python. tuples unpacking immutability
- 3 Dictionaries Look values up by name instead of position — the collection behind configuration, JSON, counting and caching. dictionaries mapping json
- 4 Sets & Choosing a Collection Unique items, fast membership tests, set arithmetic — and a decision table for picking the right container. sets collections performance