Q. Explain the use of the pass statement. Illustrate it with an example.


Answer =

A pass statement is useful in those place where the syntax of language requires the presence of a statement but where the logic of the program does not.

Example = in looping

Example =

for I in range (1,11):
        if I % 2 == 0 :
                pass
                print (I)

2 Comments

You can help us by Clicking on ads. ^_^
Please do not send spam comment : )

Post a Comment

You can help us by Clicking on ads. ^_^
Please do not send spam comment : )

Previous Post Next Post