Python break statement
Python break statements, like in C, break the minimal closed for or while loop.
The break statement is used to terminate the loop statement. That is, if the loop condition has no False condition or the sequence has not been completely recursed, the loop statement will be stopped.
The break statement is used in the while and for loops.
If you use nested loops, the break statement will stop executing the deepest loop and start executing the next line of code.
Python language break statement syntax:
The above example execution results：
Current letter : P Current letter : y Current letter : t Current variable value : 10 Current variable value : 9 Current variable value : 8 Current variable value : 7 Current variable value : 6 Good bye!