We are using i two times we are using i in loop of maxitr and also inside loop of j where i =idx[j] why this is not making wrong answer

we are using i two times we are using i in loop of maxitr and also inside loop of j where i =idx[j] why this is not making wrong answer
can you explain this code :-
for i in range(5):
for j in range(3):
i=10
print(i)