0% found this document useful (0 votes)
8 views

Exception_Handling_MCQ_Options_a_b_c_d

The document contains multiple choice questions (MCQs) focused on exception handling in Python. It covers topics such as the process of throwing exceptions, the syntax of the raise statement, and the behavior of try and finally blocks. Additionally, it addresses the types of exceptions and examples of built-in exceptions.

Uploaded by

Afreed Shahid
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views

Exception_Handling_MCQ_Options_a_b_c_d

The document contains multiple choice questions (MCQs) focused on exception handling in Python. It covers topics such as the process of throwing exceptions, the syntax of the raise statement, and the behavior of try and finally blocks. Additionally, it addresses the types of exceptions and examples of built-in exceptions.

Uploaded by

Afreed Shahid
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Multiple Choice Questions on Exception Handling

MCQs on Exception Handling in Python

1. The process of creating an exception object and handing it over to the runtime system is called an
exception
a) Growing
b) Throwing
c) Executing
d) Handling

2. The syntax of raise statement is:


a) raise exception-name ((optional argument))
b) raise exception-name (optional argument)}
c) raise exception-name (optional argument)
d) None of the above

3. The statements inside the finally block are always executed regardless of whether an exception occurred
in the try block or not.
a) True
b) False
c) Depend on code
d) None of the above

4. An exception is caught in the ...... block and handles in ........... block.


a) except, try
b) try, except
c) EOF. Error
d) program, compile

5. Syntax errors are also handled as exceptions


a) False
b) Frue
c) Some times
d) None of the above

6. An exception is a Python object that represents an


a) Logic
b) Expression
c) Error
d) Module
Multiple Choice Questions on Exception Handling

7. Exception handling can be done for:


a) user-defined
b) built-in
c) Both 1 and 2
d) None

8. Commonly Built in exception:


a) Value Error
b) Import Error
c) Type Error
d) All the above

9. An exception is a Python that represents an error.


a) Class
b) Method
c) Object
d) All the above

You might also like