CUET Computer/IP: Computer ScienceException Handling. Free, no login required.

Q1:

2026: 31 May Shift 1

Exception Handling

Easy

Computer Science

Which of the following is correct syntax for handling exception in python?

Answer options
Option 2
Correct Answer
Explanation for 2026: 31 May Shift 1 CSE question 1

Q2:

2026: 31 May Shift 1

Exception Handling

Easy

Computer Science

Identify the incorrect statement about exception handling in python.

Answer options
Option 2
Correct Answer
Explanation for 2026: 31 May Shift 1 CSE question 2

Q3:

2026: 29 May Shift 2

Exception Handling

Easy

Computer Science

Each and every exception has to be handled by the programmer to avoid the program from crashing abruptly. This is done by writing additional code in a program to give proper messages or instructions to the user on encountering an exception. This process is known as _____________.

Answer options
Option 4
Correct Answer
Explanation for 2026: 29 May Shift 2 CSE question 3

Q4:

2026: 29 May Shift 2

Exception Handling

Easy

Computer Science

Match the LIST-I with LIST-II

LIST-ILIST-II
A.ImportErrorI.Raised when the subscript in a sequence is out of range
B.EOFErrorII.Raised when there is an error in the syntax of Python code
C.IndexErrorIII.Raised when the requested module definition is not found
D.SyntaxErrorIV.Raised when the end of file condition is reached without reading any data by input()
Answer options
Option 2
Correct Answer
Explanation for 2026: 29 May Shift 2 CSE question 4

Q5:

2026: 29 May Shift 2

Exception Handling

Easy

Computer Science

A / An_________ block will be executed only if exception is raised in the try block, in Python.

Answer options
Option 4
Correct Answer
Explanation for 2026: 29 May Shift 2 CSE question 5

Q6:

2026: 29 May Shift 1

Exception Handling

Easy

Computer Science

Name the built in exception when an operator is supplied with a value of incorrect data type.

Answer options
Option 3
Correct Answer
Explanation for 2026: 29 May Shift 1 CSE question 6

Q7:

2026: 29 May Shift 1

Exception Handling

Easy

Computer Science

________________ is detected when we have not followed the rules of the particular programming language while writing a program.

Answer options
Option 2
Correct Answer
Explanation for 2026: 29 May Shift 1 CSE question 7

Q8:

2026: 26 May Shift 1

Exception Handling

Easy

Computer Science

Match List-I with List-II

List-IList-II
(A) ImportError(I) When an operator is supplied with a value of incorrect data type.
(B) IOError(II) When the requested module defintion is not found.
(C) ValueError(III) When the file specified in a program cannot be opened.
(D) TypeError(IV) When an operation receives an argument having right data type but mismatched values.
Answer options
Option 2
Correct Answer
Explanation for 2026: 26 May Shift 1 CSE question 8

Q9:

2026: 26 May Shift 1

Exception Handling

Medium

Computer Science

The sequence of steps of exception handling process is:

(A) Exception object is created

(B) Exception is raised

(C) An error is encountered in a method

(D) Runtime system searches for exception handler in the current method

Answer options
Option 4
Correct Answer
Explanation for 2026: 26 May Shift 1 CSE question 9

Q10:

2026: 26 May Shift 1

Exception Handling

Easy

Computer Science

To test an expression in a program code, _____ statement in python is used.

Answer options

Q11:

2026: 24 May Shift 1

Exception Handling

Easy

Computer Science

Which of the following statement is correct with respect to exception handling in python?

Answer options

Q12:

2026: 24 May Shift 1

Exception Handling

Easy

Computer Science

The 'raise' keyword in Python is used ____.

Answer options

Q13:

2026: 23 May Shift 2

Exception Handling

Easy

Computer Science

Which of the following is the correct way to raise a custom exception in Python?

Answer options

Q14:

2026: 23 May Shift 2

Exception Handling

Easy

Computer Science

Which of the following exception is raised when the requested module definition is not found?

Answer options

Q15:

2026: 23 May Shift 2

Exception Handling

Medium

Computer Science

Arrange the following steps of handling exceptions:

A. An error encountered in a method

B. Create exception object and exception is raised

C. Runtime system searches for exception handler in the current method

D. Catching an exception

Answer options

Q16:

2026: 23 May Shift 1

Exception Handling

Easy

Computer Science

Can a single try block have multiple except clauses in Python?

Answer options

Q17:

2026: 23 May Shift 1

Exception Handling

Medium

Computer Science

Which of the following statements are correct with respect to handling exceptions in Python?

A. The try block is used to catch exceptions.

B. The except block is executed if an exception occurs.

C. You can have multiple except blocks.

D. The else block executes if no exceptions occur.

Answer options

Q18:

2026: 21 May Shift 1

Exception Handling

Easy

Computer Science

Match List-I with List-II

List-IList-II
DescriptionException Handlers
(A) Built in Exception(I) try block
(B) Throw an exception explicitly(II) ValueError
(C) Suspicious code(III) finally block
(D) Always executed regardless of exceptions(IV) raise statement
Answer options

Q19:

2026: 20 May Shift 1

Exception Handling

Easy

Computer Science

_______ statement in python is used to test an expression in the program code.

Answer options

Q20:

2026: 20 May Shift 1

Exception Handling

Easy

Computer Science

The statements inside ______ block are always executed whether an exception has occured in the try block or not.

Answer options

Q21:

2026: 19 May Shift 1

Exception Handling

Easy

Computer Science

Match List-I with List-II

List-I ExceptionList-II Description
(A) EOFError(I) It is raised when mismatched or inappropriate values.
(B) NameError(II) It is raised when an operator is supplied with a value of the incorrect data type.
(C) ValueError(III) It is raised when the end of file condition is reached.
(D) TypeError(IV) It is raised when a local or global variable name is not defined.
Answer options

Q22:

2026: 19 May Shift 1

Exception Handling

Medium

Computer Science

Arrange the following Python Code in order:

(A) try:

numerator=50

denom=int(input("Enter the denominator: "))

quotient=(numerator/denom)

print ("Division performed successfully")

(B) finally:

print ("OVER AND OUT")

(C) else:

print ("The result of division operation is ", quotient)

(D) except ZeroDivisionError:

print ("Denominator as ZERO is not allowed")

Answer options

Q23:

2026: 18 May Shift 2

Exception Handling

Easy

Computer Science

Which of the following is an incorrect statement in the context to Exception handling in Python?

Answer options

Q24:

2026: 18 May Shift 2

Exception Handling

Easy

Computer Science

Which of the following are built-in exceptions in Python?

A. EOFError

B. IndentationError

C. TypeError

D. RaiseError

Answer options

Q25:

2026: 13 May Shift 2

Exception Handling

Medium

Computer Science

What will be the output of the following code (assumes that user enters 0 when denominator is being asked)?

print("Practicing for try block")

try:

numerator=50

denom=int(input("Enter the denominator"))

quotient=(numerator/denom)

print(quotient)

print("Division performed successfully")

except ZeroDivisionError:

print("Denominator as ZERO.... not allowed")

print(“OUTSIDE try..except block”)

Answer options

Q26:

2026: 13 May Shift 2

Exception Handling

Medium

Computer Science

Consider the code given below and fill in the blanks.

print("Learning Exceptions...")

try:

num1= int(input ("Enter the first number"))

num2=int(input("Enter the second number"))

quotient=(num1/num2)

print("Both the numbers entered were correct")

except ___________: # to enter only integers

print ("Please enter only numbers")

except __________: # Denominator should not be zero

print("Number 2 should not be zero")

else:

print("Great .. you are a good programmer")

_________: # to be executed at the end

print("JOB OVER... GO GET SOME REST")

Answer options

Q27:

2026: 11 May Shift 2

Exception Handling

Easy

Computer Science

Consider the code:

arr = [3, 2, 3]

print(arr[3])

Which of the following exception is raised?

Answer options

Q28:

2026: 11 May Shift 2

Exception Handling

Medium

Computer Science

Read the following statements related to exception handling and arrange them in the correct order.

A. Exception is raised

B. Executes the exception for catching an exception

C. Program searches for exception handler

D. Create exception object

E. An Error encountered

Answer options

Q29:

2026: 11 May Shift 2

Exception Handling

Easy

Computer Science

Which of the following statements are true about Try-Except-Else clause in Python?

A. Suspicious lines of codes are put inside a try block.

B. The except block is executed if an exception occurs.

C. You can have multiple except block to handle multiple exceptions.

D. The else block is executed when no exceptions are raised.

Answer options

Q30:

2025: 3 June Shift 2

Exception Handling

Easy

Computer Science

___________is raised when the result of calculation exceeds the maximum limit of numeric data type.

Answer options