0

How to write empty function in python

Write empty function in python

In C/C++ and Java, we can write empty function as following

But in python we write like that than the compile error is occurred

output

To write empty functions, we use pass statement.
pass is a special statement in Python that does nothing.
It only works as a dummy statement.

We can use pass in empty if else statements.

Pravesh Kumar

Leave a Reply

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