PY
py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
# Python infinite loop with 3 iterations
three_iterations = False
counter = 0
while three_iterations == False:
counter += 1
print("Printed ", counter)
if counter == 3:
three_iterations = True
print("While condition no longer met...")
Enter to Rename, Shift+Enter to Preview
OUTPUT
Run