if / elseif / else
Branching based on conditions.
Syntax
if condition ... elseif ... else ... end
Description
The condition is written without parentheses, and the block ends with end. For intermediate conditions, the single word elseif is used (not else if).
Example
Loading editor…
Expected output
Adult
When to use?
Decision making, input control.
Common mistakes
- ⚠️ Not "else if", but the single word "elseif".