Practice mode Python

What does the pass statement do in Python?

Correct answer D. Nothing; it is a placeholder where a statement is syntactically required

Explanation

pass is a null operation. It is useful where the syntax requires a statement but no action is needed, such as an empty class, function stub or except block. continue is what skips to the next loop iteration, and return leaves a function.

Report a problem

Answer checked How we write and check questions

Tip: press A, B, C or D to answer, and N for the next question.

Advertisement

Have a question about this answer?

Your email address will not be published. Required fields are marked *

Links and website addresses are not allowed in comments.