Loop Control Statements:
In Python, the loop control statements are break, continue, and pass.
for i in range(10):
if i == 5:
break
print(i)
Output:
0
1
2
3
4
for i in range(10):
if i == 5:
continue
print(i)
Output:
0
1
2
3
4
6
7
8
9
for i in range(10):
if i == 5:
pass
print(i)
Output:
0
1
2
3
4
5
6
7
8
9
Note that in the above example, the pass statement has no effect on the loop’s execution, and it simply acts as a placeholder.
Learners TV is a website that is designed to educate users and provide instructional material on particular subjects and topics.