Class 12 Computer Science Exception Handling in Python PYQ, free to download as a 9-page PDF with 8 solved questions: 3 from the 2024 to 2026 board papers and 5 from CBSE's official sample papers. Exception handling is part of Computational Thinking and Programming - 2, the largest unit of the Class 12 Computer Science (083) paper.
The questions keep returning to True or False statements on errors and exceptions (5 questions), the finally block (2), the except clause (4), ZeroDivisionError (2) and logical errors (2).
On this page you get:
- 8 questions with a worked solution each: 7 MCQs and True or False items, 0 short answers and 1 code-tracing case
- An Answer Key that lists both MCQs at a glance
- Question counts by topic, so you know whether to start with error types, the finally block or except-clause order
- A marks-wise table of questions (every question in this set is 1 mark)
- The common mistakes students make, such as putting except Exception above except ZeroDivisionError, and a short FAQ
|
Table of Contents |
Exception Handling in Python Weightage in the Class 12 Computer Science Paper
CBSE publishes marks per unit, not per chapter. Exception Handling in Python belongs to Computational Thinking and Programming - 2, which carries about 40 of the 70 theory marks in the 2025-26 syllabus. That is a unit-level figure that also covers file handling, stack and the other Python chapters, so check the curriculum on cbseacademic.nic.in for the current year. The unit marks are as reported by prep sites and the published syllabus summaries, and we could not confirm them on a CBSE document, so treat them as unofficial.
This set shows how the chapter is actually asked: only 3 board questions (2024, 2025 and 2026) and 5 sample-paper questions, all worth 1 mark.
| Marks per Question | Questions in the Set |
|---|---|
| 1 mark | 8 |
| 2 marks | 0 |
| 3 marks | 0 |
| 4 marks | 0 |
| 5 marks | 0 |
Exception Handling in Python Questions by Topic
Five of the 8 questions are True or False statements. They test whether you can tell a syntax error from a runtime error and a logical error: logical errors cannot be handled with try...except...finally (2026), the interpreter does not handle them (sample 2024-25), and an exception can be raised even when the syntax is correct (sample 2023-24).
The except clause appears in 4 questions, including the 2024 board item on whether the exception name is compulsory. The finally block appears in 2: one asks when it runs, the other prints OVER after WORD5#. Two questions are output prediction, one on the string 'WORD' + N and one on two except clauses in the wrong order.
The last question, from the 2026-27 sample paper, asks what errorlog.txt contains after data(29) divides 190 by zero. Counts come from keyword matches over the question text, so a question can be counted under more than one topic. Both MCQs are listed in the Answer Key.
Source: Swati Chawla
How to Approach the Set
Start with the five True or False items and say why each is false or true in one line, since the same three ideas repeat: logical errors raise nothing, finally always runs, and the exception name after except is optional. Then trace the two output questions line by line, writing down which clause runs and what print() adds at the end. Finish with the file-writing question: find the line that raises the exception, then list what the except block writes and in which mode.
Common Mistakes in Exception Handling in Python Questions
- Putting except Exception above except ZeroDivisionError. The first matching clause runs, so the specific one is never reached and the output is Some other error!.
- Thinking finally runs only when there is no exception. It runs every time.
- Believing the interpreter catches logical errors. A wrong formula runs without any message.
- Reading 'WORD' + N as an error when N is the string '5'. Both are strings, so it prints WORD5.
- Adding a newline to the file in the errorlog.txt question. write() adds none, so the file holds Num was 29 only.
Using the Answer Key and Solutions
The PDF is 9 pages and free to download. Each section is sorted newest year first, the Answer Key lists both MCQs at a glance, and each question links to its worked solution and back. Attempt a section first, check the key, then read the solution. The solutions are written by Collegedunia's Computer Science experts and are not official CBSE marking schemes.
Class 12 Computer Science PYQs by Chapter
Exception Handling in Python Class 12 Computer Science PYQ FAQs
Ques. How many questions are in the Exception Handling in Python Class 12 PYQ PDF?
Ans. The PDF has 8 questions: 3 from the 2024 to 2026 board papers and 5 from CBSE's sample papers. 5 are True or False items, 2 are MCQs and 1 asks what a program writes to a file.
Ques. Does this PYQ PDF include solutions, or only the questions?
Ans. All 8 questions have a worked solution, and the 2 MCQs are also listed in the Answer Key before the solutions.
Ques. Are the solutions official?
Ans. No. They are written by Collegedunia's Computer Science experts, run and checked against CBSE's marking schemes where CBSE has published them (2023, 2024 and 2025 board papers and the sample papers). The 2022 and 2026 board papers have no published scheme, so those answers were worked out and run by hand. They are not an official CBSE marking scheme.
Ques. How many marks does Exception Handling in Python carry?
Ans. CBSE publishes marks per unit, not per chapter. The chapter sits in Computational Thinking and Programming - 2, which carries about 40 of the 70 theory marks in the 2025-26 syllabus. Check cbseacademic.nic.in for the current figure. All 8 questions in this set are 1-mark questions.
Ques. Which topics are asked most?
Ans. Five of the 8 questions are True or False statements on error types, the finally block or the except clause. Two are output-prediction questions and one asks what is written to a file after an exception.
Ques. What is the order of except clauses in Python?
Ans. Python runs the first except clause that matches, so a specific handler such as ZeroDivisionError must come before except Exception. The 2025-26 sample paper asks exactly this.








Comments