Python Pass Statement

RSS
EMAIL
FACEBOOK
FACEBOOK
GOOGLE
GOOGLE
https://www.poftut.com/python-pass-statement/
PINTEREST
PINTEREST
INSTAGRAM

Python provides different keywords which do not exists in other programming languages.  pass is one of the original keyword used for  nothing. pass keyword is a requirement for python block specification and syntax.

Why To pass?

Other languages generally uses some block specifier like {} or ;  etc. For example we can define functions but if we do not provide the body this may create some conflicts. So we need some statement which will provide nothing and null for the body.

In this example we can see that pass is used in two place. In the first place we defined the call function body with pass . This will give us the ability to define function without a body

In the second place we use pass in the first condition of if-else statement. We simply pass the first condition.

RSS
EMAIL
FACEBOOK
FACEBOOK
GOOGLE
GOOGLE
https://www.poftut.com/python-pass-statement/
PINTEREST
PINTEREST
INSTAGRAM

LEARN MORE  Python If-Elif-Else Multiple Conditionals Like And , Or

You may also like...

Leave a Reply

Your email address will not be published.

Enjoy this blog? Please spread the word :)