The pass statement in Python is used as a do-nothing placeholder. It allows you to create an empty code block without causing an error.
Why Pass is Needed ?
Without pass , this code will cause an error. Python expects a statement inside the block.
Python
if True: #output IndentationError: expected an indented block Example :
Python
age = 18 if age >= 18: pass # logic will be added later print("Program continues") #output Program continues