Master Python's four built-in collections — lists, tuples, sets and dictionaries — with methods, slicing, comprehensions, unpacking and set algebra. Learn which structure to reach for and why mutability matters, building the fluency the Python Institute PCAP exam expects.
Watch the free preview
Creating, indexing and slicing lists — free to watch, no account needed.
What you'll learn
- Build and manipulate lists using indexing, slicing, methods and list comprehensions
- Use tuples and sequence unpacking, and explain when immutability is the right choice
- Apply sets and set algebra to solve membership and de-duplication problems
- Create, iterate and transform dictionaries, including dict comprehensions and nesting
- Choose the correct data structure for a problem based on mutability, ordering and lookup needs
Syllabus
Lists — the Workhorse Sequence
Creating, indexing and slicing listsFree preview
List methods and comprehensions
Tuples & Mutability
Tuples and sequence unpacking
Mutability, aliasing and copying
Sets & Set Algebra
Sets, uniqueness and membership
Set algebra — union, intersection and difference
Dictionaries
Dictionaries — creation, methods and iteration
Dict comprehensions, nesting and choosing a structure
Lab — 10 Programming Exercises & Solutions
Programming Exercises 1–5
Programming Exercises 6–10