Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Nested Tuples | Other Data Types
Introduction to Python

Nested TuplesNested Tuples

Much like lists, tuples can also have nested elements.

Take, for instance, data about countries grouped into tuples. The indexing for nested tuples works just like it does for nested lists. That is, the first index points to an item in the main tuple, while the second index targets an item within the nested tuple.

Let's refresh our understanding of indexing with the following example.

¿Todo estuvo claro?

Sección 4. Capítulo 9
course content

Contenido del Curso

Introduction to Python

Nested TuplesNested Tuples

Much like lists, tuples can also have nested elements.

Take, for instance, data about countries grouped into tuples. The indexing for nested tuples works just like it does for nested lists. That is, the first index points to an item in the main tuple, while the second index targets an item within the nested tuple.

Let's refresh our understanding of indexing with the following example.

¿Todo estuvo claro?

Sección 4. Capítulo 9
some-alt