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

Q1:

2025: 3 June Shift 2

Exception Handling

Easy

Computer Science

What is an exception in Python?

Answer options
Option 3
Correct Answer
Explanation for 2025: 3 June Shift 2 CSE question 1

Q2:

2025: 3 June Shift 2

Exception Handling

Easy

Computer Science

What happens if multiple except blocks are written for the same try block?

Answer options
Option 2
Correct Answer
Explanation for 2025: 3 June Shift 2 CSE question 2

Q3:

2025: 30 May Shift 2

Exception Handling

Easy

Computer Science

Identify the incorrect built in exception from the following:

Answer options
Option 1
Correct Answer
Explanation for 2025: 30 May Shift 2 CSE question 3

Q4:

2025: 30 May Shift 2

Exception Handling

Medium

Computer Science

Arrange the steps of handling exceptions in order:

(A) The exception object is handed over to the runtime system so that it can find an appropriate code to handle this particular exception.

(B) If the runtime system is not able to find an appropriate exception after searching all the methods in the call stack, then the program execution stops.

(C) The runtime system searches the entire program for a block of code, called the exception handler that can handle the raised exception.

(D) When an error occurs, Python interpreter creates an object called the exception object.

Answer options
Option 4
Correct Answer
Explanation for 2025: 30 May Shift 2 CSE question 4

Q5:

2025: 27 May Shift 2

Exception Handling

Easy

Computer Science

Write the following Python Program in correct sequence ?

(A) print("Handling exception using try...except...else")

(B) except ZeroDivisonError:

print("Denominator as zero is not allowed")

(C) else :

print("the result of division operation is quotient")

(D)try :

numerator =50

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

quotient=(numerator/denom)

print("Division performed successfully")

Answer options
Option 2
Correct Answer
Explanation for 2025: 27 May Shift 2 CSE question 5

Q6:

2025: 27 May Shift 2

Exception Handling

Medium

Computer Science

When an exception is raised, ___________ type of built-in-exception occurs.

(A) SyntaxError

(B) ValueError

(C) KeyBoardInterruptError

(D) NameError

Answer options
Option 3
Correct Answer
Explanation for 2025: 27 May Shift 2 CSE question 6

Q7:

2025: 22 May Shift 1

Exception Handling

Easy

Computer Science

Arrange the given keywords in the blank spaces in the correct order of their appearance in the code.

try:

n1= int(input("Enter first number"))

n2= int(input("Enter second number"))

quotient= (n1/n2)

except __________:

print("Please enter numbers only")

except __________:

print("n2 can not be zero")

____:

print("Something went wrong")

____:

print( "Bye")

(A). ZeroDivisionError

(B). ValueError

(C). except

(D). finally

Answer options
Option 3
Correct Answer
Explanation for 2025: 22 May Shift 1 CSE question 7

Q8:

2025: 21 May Shift 1

Exception Handling

Easy

Computer Science

Sequence the correct order of operations in a comprehensive exception handling structure in Python:

(A) Ensure the execution of cleanup or final steps in the finally block.

(B) Handle exceptions in the subsequent except blocks.

(C) Execute the try block where errors might occur.

(D) Use the else block for code that executes if no exception occurs.

Answer options
Option 4
Correct Answer
Explanation for 2025: 21 May Shift 1 CSE question 8

Q9:

2025: 21 May Shift 1

Exception Handling

Easy

Computer Science

Match List-I with List-II

List-IList-II
(A) try(I) Handles specific errors that may occur.
(B) except(II) Block where exceptions are checked.
(C) finally(III) Block that executes regardless of preceding block results.
(D) raise(IV) Used to manually trigger an exception.
Answer options
Option 1
Correct Answer
Explanation for 2025: 21 May Shift 1 CSE question 9

Q10:

2025: 21 May Shift 1

Exception Handling

Medium

Computer Science

Out of the following statements, which one is incorrect in the context of exceptions in Python?

Answer options

Q11:

2025: 20 May Shift 1

Exception Handling

Easy

Computer Science

______ is raised when the file specified in a program statement cannot be opened.

Answer options

Q12:

2025: 16 May Shift 1

Exception Handling

Easy

Computer Science

Which of the following is not a built-in exception in python?

Answer options

Q13:

2025: 16 May Shift 1

Exception Handling

Easy

Computer Science

Consider the following code:

___:
  num=50
  demon= int(input("Enter the denominator"))
  quotient=(num/denom)
  print("Division done")
____ZeroDivisionError:
  print("Denominator is zero...not allowed")
___:
  print("The result of division sis", quotient)
___:
  print("Completed")

Arrange the following keywords to be filled in the blank spaces of the above code.

(A) else

(B) except

(C) finally

(D) try

Answer options

Q14:

2025: 16 May Shift 1

Exception Handling

Easy

Computer Science

_____________block will only be executed if some exception is raised in the _____________block.

Answer options

Q15:

2025: 15 May Shift 2

Exception Handling

Easy

Computer Science

The statements inside the _____ block are always executed regardless of whether an exception has occurred or not.

Answer options

Q16:

2025: 15 May Shift 2

Exception Handling

Easy

Computer Science

Identify the type of error shown in the code:

print(10 + '5')

Answer options

Q17:

2025: 15 May Shift 2

Exception Handling

Easy

Computer Science

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

Answer options

Q18:

2025: 14 May Shift 1

Exception Handling

Easy

Computer Science

Match List-I with List-II

List-IList-II
(A) NameError(I) raised when a built-in method receives an argument that has the right data type but mismatched values.
(B) IndexError(II) raised when an operator is supplied with a value of incorrect data type.
(C) TypeError(III) raised when subscript in a sequence is out of range.
(D) ValueError(IV) raised when a local or global variable name is not defined.
Answer options

Q19:

2025: 14 May Shift 1

Exception Handling

Medium

Computer Science

Arrange the following in the correct order of handling exceptions.

(A) Exception is raised.

(B) Run time system searches for exception handler in the current method.

(C) An Error encountered in a method.

(D) Create Exception Object.

Answer options