- Making lists with stuff in them
- access just like strings!
- O-indexed
- assignment with
list[index]syntax, touch on mutability ("this can be changed, strings can't")
- also just like strings!
- Assume class has seen
for/whilebefore, provide examples with lists
+
in
.append().pop().sort()
- Making dicts with stuff in them
- Talk about how they aren't ordered
- access looks like lists and strings!, but is a little bit different.
- assignment is kind of like with lists, but you can add whole items!
- example of iteration over keys
- introduce
.keys()and.values()by way of iteration examples
in
- Accessing items out of bounds: What happens? How can we decide whether to try accessing a certain index?
lento the rescue!
- Accessing items that aren't present: What happens? How can we decide whether to try accessing a certain index?
.get()andinto the rescue!
Shall we cover
enumerate?