Chapter 26: break and continue statement

We use the break statement to exit the loop when a certain condition is met.
The continue statement is used to skip the current iteration of the loop when a specific condition is satisfied.

# break statement
for i in range (0,10):
    if i == 5:
        break
    print(i)
Output: 
0
1
2
3
4
# continue statement
for i in range (0,10):
    if i == 5:
        continue
    print(i)
Output:
0
1
2
3
4
6
7
8
9