Writing an Empty Function using pass statement:

When we code in C++ or Java we create can empty function but in python for data science it’s not possible. Example for C++ or Java is given below –

But in Python, we cannot directly create an empty function. It will show a compile error.

A pass statement is there in Python in order to create empty functions. Pass is a dummy statement and does nothing.

python for data science

Pass can be run in while and if-else statement also.

python for data science

To learn more about empty statements in python for data science, you can check this and this as well.

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.