O'Reilly logo

The Python Quick Syntax Reference by Gregory Walters

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

CHAPTER 6

image

Data Structures

Data structures are important for most any serious (and some not so serious) programs. They allow us to store groups of related data under a single variable name and access them quickly and logically. There are many types of data structures available under Python and each will be explained in the following sections.

Data Structure Example

Let’s say that we need to keep a list of color names that are available to the end user and that list has the following values:

Red, Orange, Yellow, Green, Blue, Purple

We could simply create a number of distinct and separate variables to hold each value. On the other hand, we could ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required