Summary
My group taught this lesson as well:
Relational Operators
These are used to test the relationship between two variables. They are used for comparisons and result in a Boolean value of True
or False
.
x == y
→ equalsx != y
→ not equal tox > y
→ greater thanx < y
→ less thanx >= y
→ greater than or equal tox <= y
→ less than or equal to
Logical Operators
These are used to test multiple conditions to produce a single Boolean value.
-
AND (
&&
in JavaScript,and
in Python):
Returnstrue
only if both conditions are true. -
OR (
||
in JavaScript,or
in Python):
Returnstrue
if at least one condition is true. -
NOT (
!
in JavaScript,not
in Python):
Reverses the Boolean value — returnstrue
if condition is false, and vice versa.