Module 04 — Data structures
Concepts
- Lists: indexing, slicing, append/remove/sort
- Tuples: immutability
- Dictionaries: keys, values, items, get
- Sets: uniqueness, union/intersection
- List comprehensions (intro)
- Iterating over structures
Practice prompts
- Create a list of 5 fruits; print the first and last with indexing.
- Slice
[0, 1, 2, 3, 4, 5] to get [1, 2, 3, 4].
- Given
d = {"a": 1, "b": 2}, print all keys and all values.
- From two lists, build a set of unique elements combined.
- Use a list comprehension to make
[1, 4, 9, 16, 25] from [1..5].
Complete the TODOs in starters.py.