5
Built-In Data Structures Part 2: Dictionaries
Python has a rich collection of built-in data structures. These data structures are sometimes called "containers" or "collections" because they contain a collection of individual items. These structures cover a wide variety of common programming situations.
In this chapter, we'll build on some of the basics introduced in Chapter 4, Built-In Data Structures Part 1: Lists and Sets. This chapter covers the dictionary structure. This is a mapping from keys to values, sometimes called an associative array.
This chapter will also look at some more advanced topics related to how Python handles references to mutable collection objects. This has consequences in the way functions need to be defined.
In this ...
Get Modern Python Cookbook - Second Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.