Name

break

Examples
for i in range(5):
    if i == 2: 
        break
print(i) # Prints 2
Description Ends the execution of a structure such as for, or while and jumps to the next statement after.
Syntax
	for i in xrange(10):
	    statements
	    if (condition):
	        break

	while (i < 10):
	    statements
	    if (condition):
	        break
Related for
while

Updated on Tue Feb 27 14:07:12 2024.

If you see any errors or have comments, please let us know.