What is pass in python?

Pass is keyword which is a used to write a null statement. It does not return anything when executed. It helps us to write the loops, functions, classes, etc without any value in it to use it later. It minimizes the compilation error.
e.g.,
a=5 for i in range(a): pass

Let us see another example of class with pass statement.
class helloworld: pass

This is all about pass statement in python.
Subscribe
Login
Please login to comment
0 Discussion