1. Home
  2. Data Science
  3. Python
  4. Which block always runs, whether or not an exception…

Added 25 Nov 2026

Which block always runs, whether or not an exception occurred in Python?

  1. else
  2. always
  3. finally Correct answer
  4. ensure

Correct answer

C. finally

5 views

MCQSEXAM

Explanation

finally executes for cleanup regardless of exceptions.

Reference

Asked in: Python Interview Exception Handling

https://docs.python.org/3/tutorial/errors.html

Preparing for an exam?

Doubts & discussion

Not sure why the answer is C? Ask here and get an explanation.

Ask a doubt about this MCQ

Shown after review. No links please.

More Python MCQs

Practise all Python MCQs

Similar MCQs