While Loop in Python

While Loop in Python programming is a control flow statement that allows code to be executed and repeat a specific block of code until the boolean condition is met.

Operators in Python

Operators Type
! Logical NOT
*   /   % Arithmetic and modulus
+   - Arithmetic
<   >   <=   >= Relational
==   != Relational
&& Logical AND
|| Logical OR
= Assignment

General form of While Loop


initialise loop counter
while test loop counter using a condition:
	do this
	and this
	increment loop counter

While Loop Printing 0 to 10

Program

a = 0
while a <= 10: #loop looping from 0 to 10.
    print(a) #printing looped value.
    a+=1 #adding 1 to 'a' like 'a = a + 1'.
Output
0
1
2
3
4
5
6
7
8
9
10