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

Course Content

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.

Everything was clear?

Section 4. Chapter 9
course content

Course Content

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.

Everything was clear?

Section 4. Chapter 9
some-alt