Python - Break Statements

In python break statements can alter the flow of a normal loop,loops iterate over a block of code until test expression is false.the following example of break statements.

Example


for val in "bharat":
	if val == "r":
		break;
		print(val);
							
							

Output


b
h
a
							
							
Share Share on Facebook Share on Twitter Share on LinkedIn Pin on Pinterest Share on Stumbleupon Share on Tumblr Share on Reddit Share on Diggit

You may also like this!