Chapter 8. Lists and Dictionaries

Now that we’ve learned about numbers and strings, this chapter moves on to give the full story on Python’s list and dictionary object types—collections of other objects, and the main workhorses in almost all Python scripts. As you’ll see, both types are remarkably flexible: they can be changed in place, can grow and shrink on demand, and may contain and be nested in any other kind of object. By leveraging these types, you can build up and process arbitrarily rich information structures in your scripts.