Loading topic
str, int, list and tuple, for loops and conditionals, and the difference between mutable and immutable objects.2 min readstr, int, list, tuple), and the difference between mutable and immutable objects. It also assumes you can already build a dictionary with a literal or dict().3 min readtry/except. It covers the three ways to read from a dictionary and when to use each.2 min read[] and get(), and know that dictionaries are mutable. Here you will change a dictionary in place. You will add entries, replace values, and remove entries without surprise errors.2 min readfor loops, f-strings, and the difference between mutable and immutable objects. It also assumes you can create a dictionary and read values from it, as covered in earlier chapters.3 min readkeys(), values() and items(). It covers what order a dictionary keeps, which operations change that order, and why two dictionaries can be equal even when their order differs.3 min read| operator, ** unpacking, and update(). It assumes you can create dictionaries, read and assign keys, and know that dictionaries are mutable. The | and |= operators need Python 3.9 or newer.2 min readdict.items(). It also assumes you know that dictionary keys must be hashable.2 min readget() and in, and know that d[key] raises KeyError when the key is missing. Counting and grouping are the two jobs where that KeyError gets in your way most often.2 min readitems(), write a lambda, and know that a dictionary keeps insertion order. Here you will use those pieces to produce sorted views of a dictionary.2 min readfor loops, know that dictionaries are mutable, and have used del, pop() and items(). It covers one common error: changing a dictionary's size while a loop is reading it.2 min readkey in d and d[key] stay fast as a dictionary grows, and what that requires of your keys.3 min read