Chapters
Python114 chapters

ReferenceKeywords

break

Leaves the innermost loop immediately.

Signature

break

Returns

Nothing.

Example

Python
for n in [1, 2, 3, 4]:
    if n == 3:
        break
    print(n)

Output

1
2

See also