The Pass Statement: How to Do Nothing in Python

In Python, the pass the keyword is an entire statement in itself. This statement doesn’t do anything: it’s discarded during the byte-compile phase. But for a statement that does nothing, the Python statement is surprisingly useful.

Sometimes pass is useful in the final code that runs in production. More often, pass is useful as scaffolding while developing code. In specific cases, there are better alternatives to doing nothing.

Default image
Lingaraj Senapati
Hey There! I am Lingaraj Senapati, the Co-founder of My skills are Freelance, Web Developer & Designer, Corporate Trainer, Digital Marketer & Youtuber.
Articles: 145

Newsletter Updates

Enter your email address below to subscribe to our newsletter

Leave a Reply

3 × 1 =

Physical Address

Patia, Bhubaneswar, khordha, 751024, Odisha, India