In this lesson, students will learn more about boolean values. Booleans refer to a value that is either true or false, and are used to test whether a specific condition is true or false.
Students will be able to…
- Create boolean variables to represent meaningful yes/no values
- Print out the value of a boolean variable
Logical operators allow us to connect or modify Boolean expressions. Three logical operators are the !, ||, && characters.
* ! = NOT
* || = OR
* && = AND
Logical operators can be used in combination.
With these logical operators, we can construct logical statements such as “I go to sleep when I am tired OR it’s after 9pm”, “I wear flip flops when I am outside AND it is NOT raining”