Course Content
What is Python?
Introduction of Python and Its setup
0/2
Control Statement
Control statements are used to control the flow of execution depending upon the specified condition/logic.
0/4
File Handling
File handling is an important component of any application. Python has multiple functions for creating, reading, updating, and deleting files.
0/2
Examples
Following are the examples of python scripts to try hands-on, you are ready to start your python journey.
0/7
Python
About Lesson

Jump Statements are used to pass the program’s control from one location to another. This means these are used to modify the flow of a loop like-to skipping a part of a loop or terminating a loop.

1)Break

It is used to terminate the loop.

for val in "string":  
      if val == "i":  
             break  
      print(val) 

In the above code, we break the loop as soon as “i” is encountered, hence printing “str”.

2)continue

It is used to skip all the remaining statements in the loop and transfer controls back to the top of the loop.

for val in "init":  
      if val == "i":  
            continue  
       print(val)  
print(" The End") 

In the above code, we are printing “nt”, because it will skip letter “I”.

3)pass

It can be used when a statement is required syntactically but you do not want any code to execute.

for i in "init":  
      if(i == "i"):  
            pass  
      else:  
           print(i) 

Continue forces the loop to start the next iteration while pass means “there is no code for execution” and will continue through the remainder of the loop body. The output will be “nt”.