A loop else is used to identify if the loop is terminated normally or the execution is interrupted by a break statement.
Loop else
A loop else statement runs after the loop's execution is completed without being interrupted by a break statement.
Source & attribution
Introduction to Python Programming — Loop else
OpenStax contributors · OpenStax, Rice University
CC BY 4.0. Text excerpted; whitespace normalised and empty cross-references removed; learning prompts added. No illustrations reproduced.
Source edition: 2024-07-30T19:17:56Z
A note to yourself
Create an account or sign in to keep private notes and saved takas across devices.