[Type A] Python Revision Tour-1 – Chapter 1

|
Table of Contents

19. Explain the use of the pass statement. Illustrate it with an example.

The pass statement in Python is a null operation. It is used when a statement is syntactically required but you do not want to execute any code. It acts as a placeholder and does nothing.

if condition:
    pass  # do nothing
else:
    print("Condition is false")

Leave a Reply

Your email address will not be published. Required fields are marked *