While with complex expression



examples/loops/while_complex_condition.py
import random
random.seed(0) # used so we can verify the results in the next example

total = 0
while (total < 10000000) and (total % 17 != 1) and (total ** 2 % 23 != 7):
    print(total)
    total += random.randrange(20)

    # do the real work here

print("done")

0
12
25
26
34
50
65
77
done