Exception Handling - Worksheet 1 - 1 Marks
Exception Handling - Worksheet 1 - 1 Marks
Worksheet – 1
1. In a try-except block, can there be multiple 'except' clauses?
a) No, there can be only one 'except' clause.
b) Yes, but only if the exceptions are of the same type.
c) Yes, it allows handling different exceptions separately.
d) No, 'except' clauses are not allowed in a try-except block.
25. In a try-except block, if an exception occurs but it is not handled by any except
clause, what happens?
a) The program terminates b) The exception is ignored
c) The program continues to execute normally d) None of the above