We are using two times i

the loop of maxitr i also in i and i=idx[j] why this is not making wrong answers
can you explain this code
for i in range(5):
for j in range(3):
i=10;
print(i)