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!')
- A.
Some Error!
- B.
Division by Zero Error!
- C.
No Error
- D.
This program raises a Syntax Error
Attempted by 90 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!