Why is else clause of loops used?
Answer:
In python, the else clause of loops is executed only when the loop terminates normally ie., when all the iterations have been completed or when the condition tests to be false.
Very Short Answer Type Questions (1 Mark each)
Last updated at April 16, 2024 by Teachoo
Answer:
In python, the else clause of loops is executed only when the loop terminates normally ie., when all the iterations have been completed or when the condition tests to be false.