<div>a = [[0,1,2,3,4,5],[1,2,3,4,5,6]]</div>  <div>You cannot modify the same array when you are looping through it. You have to loop through the copy of the contents :- a[:].</div>  <div>&nbsp;</div>  <div># Untested code</div>  <div>for i in a[:]: # You are looping through the copy of contents</div>  <div>&nbsp;</div>  <div># I'm new I'm going to try and explain my understanding of this code; pls correct if wrong<BR># i[0] is [0,1,2,3,4,5] and i[1] is the other<BR># the loop first goes to the list on the left then goes to the list on the right</div>  <div><BR>&nbsp;&nbsp; for j in i:</div>  <div><BR>#each element in the sublist is now evaluated<BR># first 0 in i[0] then 1 in i[1] then back to 1 in i[0] and then to 2 in i[1]--------- is this right? <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # implement your logic with j<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if j &lt; i[0]: # or any dynamic conditional check.</div>  <div><BR>the first time this loops,<BR>0 in the first list
 or i[0] is evaulated against itself<BR>what is the next j value for the next loop?<BR>&nbsp;&nbsp; a[i][j] = j &lt;--------- don't understand this bit</div>  <div>&nbsp;</div>  <div>&nbsp;</div>  <div><BR>Does this help you?</div>  <div>&nbsp;</div>  <div>I've looked on the net as well as my book (python dummies), but can't find an explantion for nested for loops in&nbsp;nested lists.&nbsp; Would it be possible to explain?&nbsp; Thank you.</div><p>&#32;



      <hr size=1>Never miss a thing.  <a href="http://us.rd.yahoo.com/evt=51438/*http://www.yahoo.com/r/hs"> Make Yahoo your homepage.</a>