PASS, CONTINUE, BREAK

PASS, CONTINUE, BREAK

Pass

The pass statement is a null operation in Python, which means, nothing happens when it executes, but is required to avoid generating errors. Python pass keyword is used to create the code skeleton without popping up any syntactical error during code compilation. At many places, you want to design a python control structure or function but do not want them to execute during compilation. In such a scenario, you can use the “pass” keyword. You can find the example of “pass” in subsequent sections.

Continue

In Python, continue keyword is used to skip the current execution and control of the loop pints at the beginning of the loop. Consider a scenario where you want to skip the current execution upon meeting a certain condition then you can use continue keyword. You will see an example of a continue with different loops in the subsequent section.

Break

Python break is used to get an early exit from the loop (be it for loop or while loop). Consider a scenario, where you want to execute a loop from beginning till the end but at the same time, you also want the loop to terminate upon meeting certain criteria in between the execution. You will see an example of a break with different loops in the subsequent section.