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