Python while Keyword

Creates a while loop. A while continues looping over the enclosed code block until the while condition is no longer True.

Example

Python
x = 0
while x < 5:
    print(x)
    x = x + 1

Output

0
1
2
3
4