1. Break
Break is to terminate this cycle, such as you many while loop, you write a break in one of the while loop, satisfies the condition, only terminates this while inside the loop, the program jumps to the upper layer while loops continues to go down
Example with a simple for loop
For I in range (10):
Print ("-----%d-----"%i)
For j in Range (10):
If J > 5:
Break
Print (j)
When we meet j>5, the second layer of for does not loop, continue to jump to the previous layer of the loop
2, continue
Continue is the time to loop to this point, to perform some of the operations continue here, after the execution, continue to loop to meet the conditions of this layer of the loop need to do, do not terminate this layer of loop
The above example makes a change
For I in range (10):
Print ("-----%d-----"%i)
For j in Range (10):
If J > 5 and J <= 8:
Print ("I am continue special")
Continue
Print (j)
The loop here will print out what J needs to do between 5-8, but will not terminate the second loop, do not satisfy the number between 5-8, and then loop on the following things to do
3, exit () exit the whole program, very good understanding
4, pass is just a placeholder, what do not do
A brief analysis of break continue exit () pass in Python