how to loop until a condition is met python code example
Example 1: python loop until condition met
finished = False
while not finished:
... do something...
finished = evaluate_end_condition()
Example 2: how to repeat code in python until a condition is met
a = 1
b = 1
while (a<10):
print ('Iteration',a)
a = a + 1
b = b + 1
if (b == 4):
break
print ('While loop terminated')