-
Notifications
You must be signed in to change notification settings - Fork 1
Operators
Jordan Leppert edited this page Jan 9, 2025
·
7 revisions
Most operators take two operands (inputs). The syntax is:
<operand 1><operator symbol><operand 2>
Example:
123+456
Whitespace is permitted between the operands and operator. The operator symbol can be multiple characters. If it only contains letters, then there must be a non-word character immediately after the symbol. For example:
# This is fine
(true)and(true)
# This is not
(true)andtrue
By default there is one operator that takes a single operand, the "not" operand.
# Outputs False
not true
By default there is one operator that takes more than two operands, the "then/else" operator, which is like the ternary (?/:) operator from various programming languages.
a = 5
a % 2 == 0 then 'even' else 'odd'