Identify the correct outcome produced by the Python program from the given…

2026

Identify the correct outcome produced by the Python program from the given options.
code:
A, B = 10, 0
try:
print(A % B)
except ZeroDivisionError:
print('Division by Zero Error!')
except:
print('Some Error!')

Answer: B. Division by Zero Error!A = 10 and B = 0. The statement A % B causes a ZeroDivisionError because modulo by zero is not allowed. This error is caught by the specific except…

  1. A.

    Some Error!

  2. B.

    Division by Zero Error!

  3. C.

    No Error

  4. D.

    This program raises a Syntax Error

Attempted by 209 students.

Show answer & explanation

Correct answer: B

A = 10 and B = 0.
The statement A % B causes a ZeroDivisionError because modulo by zero is not allowed.
This error is caught by the specific except ZeroDivisionError block, so it prints:
Division by Zero Error!

Explore the full course: Rssb Senior Computer Instructor

Loading lesson…