Python Break

In this page you learn about of break statement is a wall statement that is used to license the control to the finish of the loop. When break statement is functional the control ideas to the line behind the body of the loop , later applying break statement makes the loop to dismiss and controls goes to next line filling after loop body.

Example

for i in [1,2,3,4,5]:
    if i==4:
        print "Element found"
        break
    print i,

Output

>>> 
1 2 3 Element found
>>>