PYTHON

Control Flow : Transfer Statement


There are 3 types of transfer statements:

1. break : We can use break statement inside loops to break loop execution based on some condition.

2. continue : We can use continue statement to skip current iteration and continue next iteration.

3. pass : In our programming syntactically  if block is required which won't do  anything then we can define that empty  block with pass keyword.

  • It is an empty statement
  • It is null statement
  • It won't do anything

 

Loop with else block

  • Inside loop execution, if break statement not executed, then only else part will be executed.
  • else means loop without break
     

 


PYTHON