InterviewSolution
Saved Bookmarks
| 1. |
What are the two types of else clause in Python ? |
|
Answer» The two types of Python else clauses are : (i) else in an, if statement (ii) else in a loop statement The else clause of an if statement is executed when the condition of the if statement results in false. The else clause of a loop is executed when the loop is terminating normally i.e. when its test-condition has gone false for a while loop or when the for loop has executed the last value in the sequence. |
|