The simplest statement is the empty statement i.e., a statement which does nothing. In python an empty statement is pass statement.
Whenever the python encounters a pass statement, python does nothing and move to next statement in the flow of control.
A pass statement is useful in those instances where the syntax of the language requires the presence of a statement but where the logic of the program does not.
syntax:-
for variable in sequence: pass
e.g.,
l =['A', 'B', 'C', 'D', 'E'] for i in l: if(i =='A'): pass else: print(i)
output- B C D E
This is all about pass statement in python.