-
Book Overview & Buying
-
Table Of Contents
Python Illustrated
By :
In the previous chapters, we learned how to store individual pieces of data using variables and how we can use variables to make decisions. But imagine trying to keep track of every single treat, toy, or bird you’ve ever seen using separate variables. It would be like having a separate bowl for each piece of kibble. Yes, I agree, that’s not very efficient!
Luckily, Python offers us tools to handle collections of data. These are lists, dictionaries, and tuples. We call those data types as well, but they are special kinds of data types called collections. They are like containers where you can store multiple values, each with its own special abilities and characteristics. Think of them as different types of boxes, each suited for a particular kind of content.
For example, storing the kibble in the basket that we use to store all my toys is not great for the kibble. And storing all the toys in the container...