0

How does break, continue, and pass work

Malarvizhi M Posted new comment
User Avatar

These statements help to change the phase of execution from the normal flow that is why they are termed loop control statements.

Python break: This statement helps terminate the loop or the statement and pass the control to the next statement.

Python continue: This statement helps force the execution of the next iteration when a specific condition meets, instead of terminating it.

Python pass: This statement helps write the code syntactically and wants to skip the execution. It is also considered a null operation as nothing happens when you execute the pass statement.