0% found this document useful (0 votes)
18 views

Pythonquestion 15

Pass is a keyword in Python that represents a null operation. It is used to fill empty blocks of code that may execute during runtime but have not been written yet. Without using pass, errors can occur as Python expects an indented block of code.

Uploaded by

ameetamarwadi
Copyright
© © All Rights Reserved
Available Formats
Download as ODT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
18 views

Pythonquestion 15

Pass is a keyword in Python that represents a null operation. It is used to fill empty blocks of code that may execute during runtime but have not been written yet. Without using pass, errors can occur as Python expects an indented block of code.

Uploaded by

ameetamarwadi
Copyright
© © All Rights Reserved
Available Formats
Download as ODT, PDF, TXT or read online on Scribd
You are on page 1/ 1

 What is pass in Python?

The pass keyword represents a null operation in Python. It is generally used for the purpose of
filling up empty blocks of code which may execute during runtime but has yet to be written.
Without the pass statement in the following code, we may run into some errors during code
execution.
def myEmptyFunc():
# do nothing
pass

myEmptyFunc() # nothing happens

## Without the pass keyword


# File "<stdin>", line 3
# IndentationError: expected an indented block

You might also like