This code is perfectly valid Python
x=[[1,2,3,4], [11,22,33,44]] for e in x: for e in e: print e
Can someone please tell me why
Because second e binds after first e evaluates to list. So, all other iteration steps take items not from variable, but from list. For example, in next code reassinging to e has no effect on iteration:
e
for e in x: for i in e: print i e = [8, 8, 8]