python: How to refer to specific item within a list of lists?

Posted by user964689 on Stack Overflow See other posts from Stack Overflow or by user964689
Published on 2012-06-18T09:11:01Z Indexed on 2012/06/18 9:16 UTC
Read the original article Hit count: 129

Filed under:
|

Python beginner here, I have a list of lists and want to refer to a specific part of that list.

For example

lol = [[1, 2, 4], [6, 7, 8], [9, 10, 14]]

If I just want to print the first item in one of the lists, eg the 1, 6 or 9, how would I do that?

I can only find ways to refer to each of the lists seperately eg lol[0] but not to then refer to an item within that list.

Thank you in advance for your help!

Cheers

© Stack Overflow or respective owner

Related posts about python

Related posts about list