Outer Loop (for i in range(1, 4)):
The outer loop goes through numbers \(1\), \(2\), and \(3\).
range(1, 4)
means "start at \(1\) and go up to (but not including) \(4\)." So, it will produce the numbers \(1\), \(2\), and \(3\).
Inner Loop (for j in range(10, 13)):
For each value of \(i\) from the outer loop, this inner loop goes through numbers \(10\), \(11\), and \(12\).
range(10, 13)
means "start at \(10\) and go up to (but not including) \(13\)." So, it produces the numbers \(10\), \(11\), and \(12\).
Output of Nested Loops
First Group: When i = 1
:
It prints 1
with 10
, 11
, and 12
.
Second Group: When i = 2
:
It prints 2
with 10
, 11
, and 12
.
Third Group: When i = 3
:
It prints 3
with 10
, 11
, and 12
.