Skip to main contentSkip to solution

Match List-I with List-II

List-IList-II
(A) try(I) Handles specific errors that may occur.
(B) except(II) Block where exceptions are checked.
(C) finally(III) Block that executes regardless of preceding block results.
(D) raise(IV) Used to manually trigger an exception.

Solution

✅ Correct Option: 1
List IList II
(A) try(II) Block where exceptions are checked.
(B) except(I) Handles specific errors that may occur.
(C) finally(III) Block that executes regardless of preceding block results.
(D) raise(IV) Used to manually trigger an exception.

The risky code goes inside try. If it fails, the matching except block catches the error. The finally block runs whether or not an error occurred.

Do not swap try and except: try only watches for errors, while except is the one that handles them.

Keyboard Shortcuts

  • Left arrow: Previous question
  • Right arrow: Next question
  • S key: Jump to solution
  • Q key: Jump to question