What is the output of the following commands entered in the Python Interactive shell?
Because the try block completes without raising an exception, Python executes the else block and skips except. The finally block executes regardless of whether an exception occurred, so the output is Try Else Finally.
try
else
except
finally
Try Else Finally
Community Discussion