On Mon, May 9, 2011 at 1:15 PM, Chris Roy-Smith
<chris_roysmith.noth...@internode.on.net> wrote:
> Just learning python.
> I can see that I can address an individual element of a list of lists by
> doing something like:
> row = list[5]
> element = row[3]
>
> But is there a way to directly address an entry in a single statement?

Yep!

element = list[5][3]

Everything's an expression, there's nothing special about something
that's stored in a variable. You can even use square brackets after a
function call that returns a list (which is very useful at times).

Chris Angelico
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to