- Daniel Arbuckle's Mastering Python
- Daniel Arbuckle
- 108字
- 2021-07-02 21:09:31
Python's built-in data structures and comprehensions
Now, let's take a look at the core data structure types of Python. These aren't the only data structures available, of course, because it's fairly easy to create data structures using classes. However, these data structures are built right into the heart of Python and they're highly efficient, so it's a good idea to be very familiar with them.
The first thing to understand is that data structures are themselves data values similar to a filing cabinet-they're one thing that contains many things. Like any other data value, they can be stored in a variable or used as part of an expression.