Python - For Loop
What happens to the else block in a for-else statement if the loop completes all iterations without a break?
What happens to the else block in a for-else statement if the loop completes all iterations without a break?
else block in a for loop runs only if the loop finishes all iterations without encountering a break.else block executes after the loop ends.15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions