Python Programming - Loops - Discussion

Discussion Forum : Loops - General Questions (Q.No. 6)
6.
Which of the following statements accurately describes the behavior of the else block in a Python while loop?
It is executed when the loop condition is True.
It is executed when the loop is terminated prematurely.
It is executed only if an exception occurs in the loop.
It is executed when the loop condition becomes False.
Answer: Option
Explanation:
The else block in a while loop is executed when the loop condition becomes False.
Discussion:
Be the first person to comment on this question !

Post your comments here:

Your comments will be displayed after verification.