In this page we have given CBSE Board Class 12 Computer Science with Python Book Chapter Exception Handling & Generate Functions MCQ Question and Answer. All the questions below are important for our CBSE Champs.
- Board – CBSE.
- Class – 12
- Subject- Computer Science with Python.
- Topic- MCQ.
- Number of MCQ- 18.
1.)……………………… are exceptional, unusual and unexpected situations and they are never part of the normal flow of a program.
a.)Algorithm
b.) Flowchart
c.) Errors
d.) Class
Ans- c.) Errors
2.) It is the process of responding in such situations.
a.) Exceptions Handling
b.) Error Handling
c.) Program Handling d.) None of these
Ans- a.) Exceptions Handling
3.) The statement that is used for raising exception program.
a.) raise
b.) update
c.) upgrade
d.) upload
Ans – a.) raise
4.) The statement allows the programmer to force a specified exception to occur.
a.) if – else
b.) raise
c.) if
d.) to
Ans – b.) raise
5.) As the argument is optional the default value is ………………….. which is used in case the argument is not provided.
a.) None
b.) 1
c.) 10
d.) 50
Ans – a.) None
6.) The error which is raised when we try to perform an operation on incorrect type of value.
a.) IO Error
b.) Index Error
c.) Name error
d.) Type Error
Ans – d.) Type Error
7.) The error is raised when I/O operator fails
a.) IO Error
b.) Index Error
c.) Name error
d.) Type Error
Ans – a.) IO Error
8.) The error which raises when one of the file method i.e read(), readline(), or readlines(), try to read beyond the file.
a.) EOF Error
b.) Index Error
c.) Name error
d.) Type Error
Ans – a.) EOF Error
9.) The …………………….. is raised when a built in function/method receives an argument of correct type but with inappropriate value.
a.) Value Error
b.) IO Error
c.) Index Error
d.) Import Error
Ans- a.) Value Error
10.) This error is raised when in division operation, denominator is zero.
a.) Zero Division Error
b.) EOError
c.) IndexError
d.) IOError
11) This statement is used when we think that the code might fail.
a.) try…..except
b.) If
c.) If – Else
d.) None of these
Ans- a.) try…..except
12.) The ……………….. clause written after all except statements, is executed, if code in try block does not raise any exception.
a.) try…..except
b.) If
c.) If – Else
d.) Else
Ans – d.) Else
13.) It is the repetition of a process in computer program.
a.) Iteration
b.) Alteration
c.) adulteration
d.) None of these
Ans – a.) Iteration
14.) It is used to allow a user to process every element of container, without knowing internal structure of the container.
a.) Proforma
b.) Instructions
c.) Protocol
d.) Method
Ans- c.) Protocol
14.) In Iteration protocol, every iterator should have three operator which are
…………………. , ………………………. and ………………..
a.) Addition, subtraction, Multiplication b.) Top, Middle, Bottom
c.) Increment, De-referencing, Non-equality comparison
d.) All of these
Ans – c.) Increment, De-referencing, Non-equality comparison
16.) This helps us to write user defined iterator, without worrying about the iterator protocol.
a.) Adjuster
b.) Generator
c.) Creator
d.) Developer
Ans- b.) Generator
17.) This functions are not much different from normal functions, and use def to define a function.
a.) try…..except
b.) If
c.) If – Else
d.) Generator
Ans – d.) Generator
18.) The statement which allows the generator function to suspend the processing and send a value, simultaneously retaining the existing state of generator to resume processing over time.
a.) try…..except
b.) yield
c.) If –Else
d.) Generator
Ans – b.) yield