PRACTICE / UNDERSTAND / REPEAT

Python practice question

Practice exceptions with self-contained questions. Check your answer, then use the explanation to understand the reasoning.

1 questionAnswers explainedFree · no login

Try this question

Exceptions · MCQQuestion link ↗

Which clause runs only when the `try` block raises no exception?

Choose one answer
Answer & explanation

Answer: else

`else` runs if no exception occurred. `finally` runs regardless of success or failure.