pythonreference.com

search statements, functions, methods, exceptions*

show categories

break
exit a looping block and continue execution below it
x = 0
while True:
    x = x + 1

    if x > 3:
        break

    print(x)
print('continuing...')
'break' can be placed anywhere in a looping block; if it is reached, execution immediately drops below the block