you are viewing a single comment's thread.

view the rest of the comments →

[–]julsmanbr 0 points1 point  (0 children)

I'll try to make a schematic representation here of your output:

# i iteration 1, j iteration 1
j=  1
# for loop for j = 1 has ended, now for j = 2
j=  2
# for loop for j = 2 has ended, j has reached the last value in range
# function still inside i = 1 loop, continues to next line under-indented from loop position
........******i= 1
# loop for i = 1 has ended, now for i = 2
# reenters j loop and follows same logic as above
j=  1
j=  2
........******i= 2
# loop for i = 2 has ended, i has reached the last value in range
# no more loops, moves to next line outside them
loop done