The while loop may be used to repeat a code block until a condition is fulfilled:
while condition: <code>
A while loop is equivalent to the following code:
for iteration in itertools.count(): if not condition: break <code>
So a while loop used to repeat a code block until a condition is fulfilled is equivalent to an infinite iterator, which might be stopped if a condition is fulfilled. The danger of such a construction is obvious: the code may be trapped in an infinite loop if the condition is never fulfilled.
The problem in scientific computing is that you are not always sure that an algorithm will converge. Newton iteration, for instance, might not converge at all. If that algorithm were implemented inside a while loop, the corresponding code would be trapped in an infinite loop for some choices of initial conditions.
We, therefore, advise that finite...