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(" ")