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 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.

Все було зрозуміло?

Секція 4. Розділ 9
course content

Зміст курсу

Introduction to Python

Nested 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.

Все було зрозуміло?

Секція 4. Розділ 9
some-alt