Python While Loop

The while loop in python is used to iterate over a block of code as long as the test expression is true.we generally use this loop when we don't know beforehand,the number of times to iterate.the foolowing syntax of while loop in python.


while condition:
	body of while loop


a = 1;
while a<=5:
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!