English

Can one block of except statements handle multiple exceptions? -

Advertisements
Advertisements

Question

Can one block of except statements handle multiple exceptions?

Options

  • yes, like except TypeError, SyntaxError [,...]

  • yes, like except [TypeError, SyntaxError]

  • no

  • None of the mentioned

MCQ

Solution

yes, like except TypeError, SyntaxError [,...]

Explanation:

It is possible to directly specify each kind of exception. It is not necessary to include it in a list.

shaalaa.com
Handling Exceptions
  Is there an error in this question or solution?
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×