Question 111 markVery Short AnswerSection A

State whether the following statement is True or False :

In Python, Logical errors can be handled using try......except......finally statement.

Exception Handling in Python
Exception Handling - Logical vs Runtime Errors

Official answer

False.


Logical errors cannot be caught by a try...except...finally block because they do not raise exceptions — the program runs and produces output, but the output or behaviour is incorrect.

Answer keywords:logical errorruntime errorexception handlingtry except finallysyntax errordebugging

Marking scheme

  1. 1.1 mark: answer 'False' along with correct reasoning that logical errors don't raise exceptions.

Hint

Ask whether the error stops the program (raises an exception) or just gives a wrong silent result — only the former can be handled by try-except.

Quick oral answer

False — try-except-finally only handles runtime exceptions that Python raises; a logical error produces a wrong result silently without raising any exception, so it cannot be 'caught'.

Common mistakes

  1. 1.Believing that try-except-finally can catch any kind of error, including logical errors.
  2. 2.Confusing logical errors with runtime errors — logical errors don't crash the program, so there's nothing to 'except'.

Analysis and explanation

This question tests the distinction between the different categories of errors in Python.


Types of errors

  • Syntax errors — violate Python's grammar rules; the program does not run at all (e.g., a missing colon).
  • Runtime errors (exceptions) — occur during execution (e.g., ZeroDivisionError, ValueError); these CAN be caught and handled using try...except...finally.
  • Logical errors — the program runs without crashing but produces a wrong result because the logic/algorithm itself is flawed (e.g., using + instead of * in a formula).

Why the statement is False

  • try...except...finally only intercepts exceptions that Python's interpreter actually raises during execution.
  • A logical error does not raise any exception, so there is nothing for except to catch — the program simply completes and returns an incorrect answer.
  • Logical errors can only be found through careful code review, tracing, testing, and debugging — not through exception handling.

Interesting facts

Logical errors are often considered the hardest to fix because the program runs successfully and shows no error message at all — the mistake is purely in the programmer's reasoning.

Python's try-except mechanism is built entirely around the exception object hierarchy (all exceptions derive from BaseException), so any error type that does not raise such an object cannot be caught this way.

Question details

Q11 of 48 questions

Board
CBSE
Class
Class 12
Subject
Computer Science
Year
2026
Section
Section A
Marks
1
Type
Very Short Answer
Chapter
Exception Handling in Python
Topic
Exception Handling - Logical vs Runtime Errors
Bloom's level
understand
Syllabus topic
Unit 1: Computational Thinking and Programming – 2 — Exception Handling: Runtime vs Logical Errors
Author
CBSE
Reviewed by
Padhantu Academic Team

Spotted a mistake or something unclear?

Tell us and we will fix it.

Frequently asked questions

Can any error in Python be fixed using try-except?

No. try-except can only catch runtime errors (exceptions) that Python's interpreter raises during execution, such as ZeroDivisionError or ValueError. Syntax errors prevent the program from running at all, and logical errors don't raise any exception, so neither can be handled by try-except.

How are logical errors detected then?

Logical errors are found through testing with sample inputs, tracing the code manually (dry run), using print statements or a debugger to inspect intermediate values, and careful code review — not through exception-handling constructs.