Nested tuples

Since tuples can contain any object, it's perfectly possible to have nested tuples:

>>> a = ((220, 284), (1184, 1210), (2620, 2924), (5020, 5564), (6232, 6368))

We use repeated application of the indexing operator to get to the inner elements:

>>> a[2][1]
2924

 

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset