|
Contents | Previous | Next | Subchapters |
| Syntax |
left and right left or right value
|
| See Also | xor , ordered , any , all |
and, or and not operators.
The values
left, right, and value
are logical operands.
The
and, and or operators
combine two logical values, whereas the not
operator negates a single logical value.
and operator are true,
the combined expression is true. If you enter
x = 1 < 2
y = 3 > 4
print x and y
O-Matrix will respond
F
because, although x is true, y is false.
If at least one of the values joined by the or operator is true,
the combined expression is true. If you enter
x = 1 < 2
y = 3 > 4
x or y
O-Matrix will respond
T
because, although y is false, x is true.
x = [1, 2]
y = [4, 2]
z = x == y
not z
O-Matrix will respond
[ T , F ]
because the first element of z is false
and the second element of z is true.
x = {[true, false], [true, false]}
y = {[true, true], [false, false]}
x and y
O-Matrix will respond
{
[ T , F ]
[ F , F ]
}
If you continue by entering
x and true
O-Matrix will respond
{
[ T , F ]
[ T , F ]
}