4
Built-In Data Structures Part 1: Lists and Sets
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.
We’ll look at an overview of the various collections that are built in and what problems they solve. After the overview, we will look at the list and set collections in detail.
The built-in tuple and string types were part of Chapter 1, Numbers, Strings, and Tuples. These structures are sequences, making them similar in many ways to the list collection. However, strings and tuples seem to have more in common with immutable numbers.
The next chapter, Chapter 5, will look at dictionaries, as well as some more advanced topics also related to lists and sets. In particular, it will look at how Python handles references...