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
Copy Code
x = 0 while x < 5: print(x) x = x + 1
Output
0 1 2 3 4
Creates a while loop. A while continues looping over the enclosed code block until the while
condition is no longer True
.
x = 0 while x < 5: print(x) x = x + 1
0 1 2 3 4