Uncategorized

The Python for-else Clause

The Python for-else clause is an additional, optional syntax Python's for loop has. It enables you to execute a code block after the loop had finished normally, that is, after all the items in the loop's iterable object have been iterated over. Abnormal, premature termination, due to reasons such as a break or return statement, skips that code.