How to check if an item exist in a nested list

Arash Arfaee erexsha at
Thu Jul 19 23:43:13 CEST 2007

Hi All,

Is there any way to check if an item in specific location in a multiple
dimension nested exist?  For example something like:

if M_list[line][row][d] exist:

One way is to check the length of each dimension. Does any body know a
simpler way? is there any way to check if "IndexError: list index out of
range" happened or going to happen and stop program from terminating?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the Python-list mailing list