The break statement breaks out of the smallest enclosing for or while loop.
i = 0 while True: print(i) # 0, 1, 2 i += 1 if i >= 3: break