Python pass Statement
ExampleGet your own Python Server
Create a placeholder for future code:
for x in [0, 1, 2]:
pass
Try it Yourself »
Definition and Usage
The pass
statement is used as a placeholder
for future code.
When the pass
statement is executed, nothing
happens, but you avoid getting an error when empty code is not allowed.
Empty code is not allowed in loops, function definitions, class definitions, or in if statements.