while

The while loop in Python works much as it does in many other programming languages, by looping an indefinite number of times and testing a condition before each iteration. If the condition is False, the loop ends.

  1. >>> i = 0
  2. >>> while i < 10:
  3. ... i = i + 1
  4. ...
  5. >>> print i
  6. 10

There is no loop...until construct in Python.