Answer
The break statement exits the nearest enclosing for or while loop. • Execution continues after that loop. • It also prevents the loop’s else clause from running. • It does not exit an enclosing function by itself.
💡 Simple Example
for number in range(5):
if number == 2:
break
print(number)
Output
0
1
⚡ Quick Revision
break immediately exits the nearest loop.