'pass' - Do Nothing Statements

Q

How to use the "pass" statement in Python code?

✍: FYIcenter.com

A

The "pass" statement can be used as a place holder statement any where in Python code.

When a "pass" statement is interpreted, Python will do nothing and continue with next statement.

For example, the following Python code shows an empty function with a "pass" statement:

>>> def doNothing():
...     pass
...
>>> doNothing()

 

Defining Functions in Python

'continue' Statement in Repeating Statement Blocks

Statement Syntax and Execution Flow Control

⇑⇑ Python Tutorials

2017-09-12, 1495🔥, 0💬