Skip to main content

Pass

If you want the code to "do nothing", you can use the pass keyword.

if condition:
pass

The pass keyword is usually used as a placeholder for functions and loops that you want to fill in later.

pass tells the Python interpreter that the code is fine, but it doesn't need to do anything.

note

The difference between pass and a comment is that pass is run by the machine, while comments are ignored entirely.