0 votes
in Python by

Explain the functionality of “break,” “continue,” and “pass.”

1 Answer

0 votes
by

It is one of the common questions in python interview questions and answers guide. Let’s see break, continue and pass in detail.

  1. The break statement is used for terminating a loop when a specific condition is met, and the control is transferred to the following statement.
  2. The continue statement helps to terminate the current iteration of the statement when a particular condition is met, skips the rest of the code in the current iteration, and passes the control to the next iteration of the loop.
  3. The pass statement is essentially a null operation that is used to fill up empty blocks of code that may execute during runtime but are yet to be written. It is represented by a semi-colon.
...