Empowering Students with AI-Powered Assessments & Intelligent Learning
Chapter Exam

Chapter-1 Exception Handling in Python — Online MCQ Test

COMPUTER SCIENCE · Grade 12 · CBSE(NCERT)

Practice Chapter-1 Exception Handling in Python with a free chapter-wise online MCQ test for CBSE(NCERT) Grade 12 COMPUTER SCIENCE. This chapter covers: try - except - else - finally - runtime errors - exception handling. AI-generated questions from basic to board-exam level, with instant results and explanations.

10
Questions
20m
Time Limit
3
Attempts Left
  • 10 random questions from this chapter (mixed difficulty)
  • Questions you've seen before won't repeat until the pool resets
  • You have 20 minutes — exam auto-submits when time is up
  • Maximum 3 attempts per chapter
  • Results and explanations shown immediately after submission
Login to Start This Exam →

New here? Register free — includes 3 free chapter exams.

Chapter-1 Exception Handling in Python — Important Questions & Answers (FAQ)

Frequently asked questions from CBSE(NCERT) Grade 12 COMPUTER SCIENCE — Chapter-1 Exception Handling in Python, with answers and explanations. These are sample questions; the exam has its own separate question set.

What is an exception in Python?
  • A. A type of loop used in programming
  • B. An event that occurs during program execution that disrupts the normal flow of the program ✓
  • C. A function that always returns an error
  • D. A variable that stores error messages
Answer: B. An event that occurs during program execution that disrupts the normal flow of the program
An exception is an error event that disrupts normal program execution, which Python handles using exception handling mechanisms.
Which keyword is used to catch an exception in Python?
  • A. catch
  • B. handle
  • C. except ✓
  • D. error
Answer: C. except
The 'except' keyword is used in Python to catch and handle exceptions that occur in the try block.
What happens if an exception is not caught in a try-except block?
  • A. The program continues normally
  • B. The program terminates and displays an error message ✓
  • C. The program ignores the error
  • D. The program automatically fixes the error
Answer: B. The program terminates and displays an error message
If an uncaught exception occurs, the program terminates and Python displays a traceback showing the error details.
Which exception would be caught by 'except (ValueError, TypeError):'?
  • A. Only ValueError
  • B. Only TypeError
  • C. Either ValueError or TypeError ✓
  • D. None of the above
Answer: C. Either ValueError or TypeError
Using a tuple of exception types allows catching multiple specific exceptions in a single except block.
What is the output of this code? try: raise ValueError('Invalid value') except ValueError as e: print(f'Caught: {e}') finally: print('Cleanup')
  • A. Caught: Invalid value\nCleanup ✓
  • B. Cleanup
  • C. Caught: Invalid value
  • D. Invalid value
Answer: A. Caught: Invalid value\nCleanup
The ValueError is raised and caught, printing 'Caught: Invalid value', then finally block executes printing 'Cleanup' on a new line.

Choose Your Plan & Start Practising

All plans cover every subject and chapter of your registered grade.

Free
₹0
3 exams · 1 year
Start Free →
Active
₹350
12 exams · 1 year
Get Active →
Pro
₹899
Unlimited exams · 1 year
Get Pro →

Compare all plans in detail →