What is the output of the following Python code snippet?
try:
print('A', end=' ')
except:
print('B', end=' ')
finally:
print('C')
-
A
A B C
-
B
A
-
C
B C
-
D
A C
Correct answer
6 views
Explanation
The try body runs, no exception, so else and then finally.
Doubts & discussion
Not sure why the answer is D? Ask here and get an explanation.
Ask a doubt about this MCQ