repeatare terminated by the
ifblock. Otherwise, if there is an
elseifstatement, that condition is also tested and has the exact same behavior as an
ifstatement. If none of those conditions evaluate to true, the
elseblock is executed. Each
ifstatement should be accompanied by an
endto terminate the control structure, you should not place them for any
elseifs you may place. Each statement may only contain one
if, any number of
else, and finally one
nil), the print will be executed. Otherwise, nothing will happen.
x - yis 40, which is not less than 10 nor 20, resulting in the last print being executed, since the
elsekeyword is a fallback in the case that no other conditions are truthy.
start, and stops at the number provided for
stop. The loop variable gets incremented by the
stepeach iteration, the default being 1.
1, 2, 3, 4, 5, if the condition to the
ifstatement is false, the default is used. However, if
argevaluates to true in the
1, 2, 3will be returned and not
1, 2, 3, 4, 5, since return breaks out of the function, the rest of the code will not be executed.