True
or False
. This is done using comparison
operators, logical operators, and Booleans.
Comparison Operators | |
---|---|
== | equal to |
!= | not equal to |
> | greater than |
< | less than |
>= | greater than or equal to |
<= | less than or equal to |
15 < 20
would be
True
because 15 is indeed less than 20, and
"hello" == "goodbye"
would be False
because
the phrases "hello" and "goodbye" are not the same.
and
- combines two expressions where both must be
True
or
- combines two expressions where either must be
True
not
- turns an expression from True
to
False
and vice versa
True
or False
. The name Boolean comes
from the English mathematician George Boole, who did work in the field
of logic.
Your answer
Your answer
Your answer
Your answer
Your answer
Your answer