Boolean
- A Boolean can be either
true
orfalse
.
Logical operators ¶
Operator | Description | Usage |
---|---|---|
! |
Negation | ! Bool |
== |
Equal to | Bool == Bool |
!= |
Not equal to | Bool != Bool |
and |
And | Bool and Bool |
or |
Or | Bool and Bool |
Info
-
Logical comparisons return a Boolean.
-
and
or
can be chained as many as we like:
Bool and (Bool or Bool) and Bool or ...
Warning
Ordered comparisons such as >
or <
do not work for Booleans.
Example
1 2 3 4 5 |
|