Syntax
while<condition>:
statement(s)
increment/decrement
Program 6: To print the numbers from 0 to 20 using the while loop.
Program6.py
File Edit Format Run Options Window Help LOOPS IN PYTHON
a=0
while a<=20:
print(a)
a=a+1
143
Output
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20