Question 11
Back to Exercise
What is the output of the following Python program?
def run(d):
try:
print("T", end="")
value = 10 // d
except ZeroDivisionError:
print("E", end="")
else:
print("L", end="")
finally:
print("F")
run(2)
run(0)
- A TELF TEF
- B TLF TEF Correct
- C TLF TLF
- D TF TEF
Correct Answer: Option B
Success runs try, else, finally; failure runs try, except, finally.
Discussion & Comments 0
Share your method, a shortcut, or ask about a step you didn't follow.
No comments yet. Be the first to share your solution!