Skip to main content
Skip table of contents

Else in a loop

Features

The "else" block is executed when the loop is executed until the end without being terminated by the "break" function in the middle of executing a loop.

Example

PY
L = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 }

for i in L:
	if i % 2 == 0:
		continue
else:
	tp_log("exit without break")

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.