Pass Statement in Python

Pass statement 

In python , pass statement is a null statement. Interpreter does not ignores pass statement eventually it does not do anything about pass statement.

Pass statement used to delay the time of compilation or when we do not know what code to write. In any function of a parent class which is useless to that class , but it is an useful function to it’s child classes  to avoid any error in base class then we just use pass statement.

use of pass statement in python

Implementation :

  • If there is an empty body of function or class we can use pass statement.
       def PrepInsta( ) :


     class prepInsta :

pass statement in python

Code #1: 

  • Pass statement in function and class.
#pyhton program 
#Pass statement 
#we can use pass statement for an empty funtion or class 

def prepInsta():

class prepInsta:

Code #2:

  • Pass statement in loop and decision making.
#pyhton program 
#Pass statement 
#we can use pass statement for an condition to skip


for i in range(5,12):
        print(‘Not passed for ‘, i)
Output :

Not passed for 5
Not passed for 6
Not passed for 7
Not passed for 8
Not passed for 9
Not passed for 11