This doesn’t make sense to me yet. So the first while loop runs and prints matrix[0][0], matrix[0][1], matrix[0][2] and matrix[0][3] until j=4 and isn’t less than len(matrix[i]). Okay, but now it pops out and goes back up to while i<len(matrix):. Wouldn’t this make it read j=0 again and go straight back into the nested while loop?
matrix = [[4,5,6,7],[2,4,9,3]]
i=0
while i<len(matrix):
j=0
while j<len(matrix[i]):
print matrix[i][j]
j=j+1
i=i+1
Yes, and that’s exactly what it does.
See for yourself by adding a print statement:
By the way, that is a very unpythonic way to loop in python. This is equivalent, and more suited to the language: