while
while is used for looping in Python.
The statements inside a while loop continue to execute until the condition for the while loop evaluates to False or a break statement is encountered. Following program illustrates this.
i = 5
while(i):
print(i)
i = i – 1
Output
5
4
3
2
1
Note that 0 is equal to False.