How can i eval subindex on list[ ][ ] ?

James Stroud jstroud at mbi.ucla.edu
Tue Jan 16 18:39:17 EST 2007


jairodsl wrote:
> Excuse me, i was trying in too many ways but i couldnt access subindex
> on a list , the problem is the next:
> 
> I have
> 
> indif=[[0,'A'],[1,'B'],[2,'C'],[3,'D']]
> 
> and
> 
> indic=[[0,'B'],[1,'C'],[2,'D'],[3,'E']]
> 
> i need to eval if indic[i][j] is equal to indif[i][j]
> 
> I used a double for but i had got "list index out of range". How can i
> do ???
> 
> Thanks a lot,
> 
> Cordially,
> 
> jDSL
> 

py> i = 1
py> j = 0
py> indif[i][j] == indic[i][j]
True


Works for me.

James



More information about the Python-list mailing list