THE WORLD'S LARGEST WEB DEVELOPER SITE

Python pass Keyword

❮ Python Keywords


Example

Create a placeholder for future code:

def myfunction:
  pass
Run example »

Definition and Usage

The pass keyword is used as a placeholder.

If you have an empty function definition, like in the example above, you would get an error without the pass statement.

The pass keyword can also be used in empty class definitions.


More Examples

Example

Using the pass keyword in a class definition:

class Person:
  pass
Run example »

❮ Python Keywords