While Loop Use in Python

Loop executes the same statement over and over again.While Loop is used, the statement continues to execute as long as the condition is true and the iteration of the loop when the condition becomes false; stops.

While Loop in Python, Use While Loop in Python, How Can i Use While Loop in Python

Syntax of while Loop in Python

while test_expression:
Body of while

Example of while Loop Source Code :

a = 1
while (a < 10) :
print("Value a is ", a)
a = a + 1

Output :

Value a is 1
Value a is 2
Value a is 3
Value a is 4
Value a is 5
Value a is 6
Value a is 7
Value a is 8
Value a is 9
Value a is 10