Computer Science, asked by sambru7477, 8 months ago

What is the use of break statement in python?

Answers

Answered by devanshim05
0

Answer:

It terminates the current loop and resumes execution at the next statement, just like the traditional break statement in C.

The most common use for break is when some external condition is triggered requiring a hasty exit from a loop. The break statement can be used in both while and for loops.

If you are using nested loops, the break statement stops the execution of the innermost loop and start executing the next line of code after the block.

Similar questions