Break
break
is a keyword statement that jumps out of the innermost for
or while
loop.
If you want to stop a loop under a specific condition while processing a for or while statement, use the break statement.
Conversely, if you want to skip subsequent processing and enter the next loop, use the Continue statement.
Example
str="I may use pencil."
result=""
for i in str
if i=="a" or i=="e" then break //aかeが出てきた時点で処理自体が終了する。
result=result+i
end for
print result
Output
i m