Skip to main content
Skip table of contents

반복문의 else

기능

반복문 수행 도중 break 함수로 인하여 반복문이 종료되지 않고 끝까지 수행되었을 때 else 블록이 실행됩니다

예제

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.