5
Built-In Data Structures Part 2: Dictionaries
Starting with Chapter 4, Built-In Data Structures Part 1: Lists and Sets, we began looking at Python’s rich collection of built-in data structures. These data structures are sometimes called ”containers” or ”collections” because they contain a collection of individual items.
In this chapter, we’ll cover the dictionary structure. A dictionary is a mapping from keys to values, sometimes called an associative array. It seems sensible to separate mappings from the two sequences – lists and sets.
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 chapter, we’ll look at the following recipes, all related to Python’s built-in data structures:
Creating dictionaries – inserting and updating
...