I have a 2d list of board positions where some are true some are false.
I want to iterate through them all while still having the indexes inside the nest.
aka:
for x,y in 2darray:
if 2darray[x][y] == true: print x,y
Or you can use list comprehensions:
if l is your 2darray, then you can do the following
for i, j in [(i, j) for i in xrange(len(l)) for j in xrange(len(l[i]))]:
if l[i][j]:
print (i, j)
2darray? A list of lists (that is not an array) or some sort ofnumpyarray?