python


Python Pass

The Pass Statement

In Python, the pass statement is a no operation statement. ​
That is , nothing happens when pass statement is executed.​


if (num==15):
    #write your code and remove pass
    pass
    #pass will prevent the code from syntax error
elif (num==18):
    break
            

Example:


i=0​

while i<10:​

    i=i+1​

    if(i%2!=0):​

        pass​

    else:​

        print(i)

            

Output:


2
4
6
8
10