this question is based on this other one: Nested Loop Python
One of the answer is
for i in range(1, 10):
for j in range(i):
print(i, end='')
print()
I don't understand why after the print(i, end = ' ')
statement Python then runs the print()
statement. In other words, since print()
is not in the nested loop, shouldn't this code be only run after the nested j
loop is completed?