Nested Loops

A 
nested 
loop 
is 
a 
loop 
inside 
another 
loop
.
The 
"inner 
loop"
 
will 
be 
executed 
for 
each 
iteration 
of 
the 
"outer 
loop"
.
If 
the 
outer 
loop 
runs 
for 
5 
times, 
and 
the 
inner 
loop 
runs 
for 
10 
times. 
Then 
for 
the 
1st 
outer 
loop, 
the 
inner 
loop 
will 
run 
10 
times, 
for 
the 
2nd 
outer 
loop, 
the 
inner 
loop 
will 
run 
10 
times, 
and 
so 
on.
for 
inside 
for
for iterating_var in sequence:
    for iterating_var in sequence:
       statements(s)
    statements(s)
while 
inside 
for
for iterating_var in sequence:
    while condition:
        statements
    statements
while 
inside 
while
while condition:
    while condition:
       statement(s)
    statement(s)
for 
inside 
while
while condition:
    for iterating_var in sequence:
        statements
    statements
rows = 6
for num in range(rows):
    for i in range(num):
        print(num, end=" ")  # print number
    print(" ")