Question:

The statements inside the ............ block are always executed regardless of whether an exception occurred in the ................. block. What will be the appropriate clause in the above statement respectively?

Show Hint

The "finally" block in Python will always execute, whether or not an exception occurs, and it is typically used for cleanup code.
Updated On: Apr 24, 2025
  • finally, except
  • except, finally
  • finally, try
  • try, finally
Hide Solution
collegedunia
Verified By Collegedunia

The Correct Option is C

Solution and Explanation

In Python, the "finally" block always executes, regardless of whether an exception occurs or not. The "try" block is used for code that might raise an exception. Hence, the correct order is "finally" followed by "try".
Was this answer helpful?
0
0