Python Programming - Loops - Discussion

Discussion Forum : Loops - General Questions (Q.No. 15)
15.
In Python, what is the purpose of the else block in a while loop?
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.
It is executed when the loop condition is True.
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.