Bird
0
0

Which part of the try-except structure runs if no exception occurs in the try block?

easy📝 Conceptual Q2 of 15
Python - Exception Handling Fundamentals
Which part of the try-except structure runs if no exception occurs in the try block?
AOnly the except block runs.
BNeither try nor except blocks run.
CBoth try and except blocks run.
DOnly the try block runs.
Step-by-Step Solution
Solution:
  1. Step 1: Analyze normal execution

    If no exception occurs, Python executes all code inside the try block normally.
  2. Step 2: Except block behavior

    The except block runs only if an exception occurs, so it is skipped here.
  3. Final Answer:

    Only the try block runs. -> Option D
  4. Quick Check:

    No exception = try runs only [OK]
Quick Trick: Except runs only on error; no error means try runs alone [OK]
Common Mistakes:
  • Thinking except runs even without error
  • Assuming both blocks always run
  • Believing try block is skipped on no error

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Python Quizzes