[Solved] Access a component of a list


rows  = [('x','y')]

That mean you have a list with one element and a tuple as its element.

Your list contains one element: (‘x’,’y’) at index 0.
Your tuple contains two elements: ‘x’ at index 0 and ‘y’ at index 1.

To have Y:

rows[0][1]:

           rows     [0]            [1]

                     ^              ^
                     |              |

                List Index       Tuple Index

solved Access a component of a list