![]() ![]() |
Conceptual Review (page 29 of 55) |
Python provides a few base collection or container objects such as lists, tuples, and dictionaries.
Let's start with list objects. Lists allow us to store multiple items in a single object (i.e., multiple items in a single variable similar to an array in other languages). I like to conceptualize a list as a "bag" where we can put multiple things in the bag.
Lists are one of the four built-in data types to store collections along with tuples, dictionaries, and sets (not covered in this review). Each collection type has different pros and cons.
Lists are created using square brackets during assignment [].
