Python Break Statement
You can use the Python break statement to jump out of a Python looping code. Example is when using the for loop as shown below.
------------------------------------------------
#Ouput
2
3
4
5
6
#Python break statement for i in range(2, 11): if i == 7: break print(i)
------------------------------------------------
#Ouput
2
3
4
5
6
Comments
Post a Comment