Collections ¶
We previously introduced
data types
like
int
,
float
, and
bool
.
However, these types can only represent single, simple values.
When it comes to storing, accessing, and manipulating data, we often find that we need more flexible solutions.
This is where collections come in.
Collections allow us to work with groups of data. One analogy is to think of scalar types as single eggs, while collections are like egg cartons—structured collections that store multiple eggs together. This document will cover the core collection types: lists, tuples, and dictionaries. Each solves related but distinct needs.