Nested Loops

A nested loop is a loop inside of another loop. For every single pass of the outer loop, the inner loop runs all the way through.

Nested loops
A nested loop is a loop inside of another loop. For every single pass of the outer loop, the inner loop runs all the way through.
The outer loop runs 3 times and the inner loop runs 4 times within each of those, so the inner print happens 3 times 4, or 12 times in all. Multiply, do not add.
An inner range that depends on the outer variable
The inner range does not have to be fixed. If it mentions the outer loop variable, each row can be a different length.
On the pass where i is 3, the inner range is range(1, 4), which gives 1, 2 and 3. That is why the third row has three numbers. The i+1 is there for the same reason as always: the stop value is excluded, so reaching i itself needs i+1.