For Loop using Continue in Python

In Python programming using the continue keyword in For Loop control flow statement causes the loop to jump to the next iteration of the loop immediately.

Program For Loop using Break Statement

Program

for a in range(11): #loop looping from 0 to 10.
    if a == 5: #if 'a' value Equal to 5 then
        print("The Statement is Break on 5!")
        break #break Statement.
    print(a)
Output
0
1
2
3
4
The Statement is Break on 5!

Program For Loop Using Continue Statement

Program

for a in range(11): #loop looping from 0 to 10.
    if a == 5: #if 'a' value Equal to 5 then
        print("The Statement is Continued on 5!")
        continue #Continue Statement, mean Skip 5.
    print(a)
Output
0
1
2
3
4
The Statement is Continued on 5!
6
7
8
9
10

Program Printing Triangle using For Loop

Program

for a in range(11): #loop looping from 0 to 10.
    for b in range(a): #loop looping from 0 to 'a' value.
        print("* ", end="")
    print()
Output
*
* *
* * *
* * * *
* * * * *
* * * * * *
* * * * * * *
* * * * * * * *
* * * * * * * * *
* * * * * * * * * *