Python - For Loop
What does the
else block do in a for-else statement in Python?else block do in a for-else statement in Python?for-else structureelse block in a for loop runs only if the loop finishes all iterations without encountering a break.else executesbreak, the else block is skipped. Otherwise, it runs after the loop ends.break -> Option Dfor-else else runs if no break [OK]15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions