Python Programming - Loops - Discussion

Discussion Forum : Loops - General Questions (Q.No. 31)
31.
Which of the following statements accurately describes the behavior of the else block in a Python try-except statement?
It is executed when an exception occurs in the try block.
It is executed when the try block completes without any exceptions.
It is executed only if an exception occurs in the except block.
It is executed when the program terminates.
Answer: Option
Explanation:
The else block in a try-except statement is executed when the try block completes without any exceptions.
Discussion:
Be the first person to comment on this question !

Post your comments here:

Your comments will be displayed after verification.