Python: Demonstrate an Example of pass proclamation

Python pass proclamation with an example: Here, we will realize what pass articulation in python is and how and when it is utilized?

pass explanation in python

pass” is a kind of invalid activity or invalid proclamation when it executes nothing occurs.

It is utilized when you need would prefer not to compose any code/explanation to execute however linguistically an announcement is required.

We should think about the given example…

Here, we are utilizing “pass” explanation in the capacity hello() definition – there is no announcement in the capacity and on the off chance that we don’t utilize “go“, there will be a mistake.

def hello():
    pass

hello()

Example 2:

for i in range(1,11):
     if(i==6):
         continue
     else:
         pass
     print(i)

Output:

1
2
3
4
5
7
8
9
10

Leave a Comment

error: Alert: Content is protected!!