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

Terry Reedy tjreedy at udel.edu
Wed Jan 17 03:08:40 EST 2007


"James Stroud" <jstroud at mbi.ucla.edu> wrote in message 
news:eojnn5$1vo$1 at zinnia.noc.ucla.edu...
| 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

Or, if you mean for every i and j, just

indif == indic

and let the types equality method do the work for you. 






More information about the Python-list mailing list