Lesson 2.1
A comparison answers "yes" or "no" — that is True or False:
| Operator | Meaning | Example | Answer |
|---|---|---|---|
> |
greater than | 5 > 3 |
True |
< |
less than | 5 < 3 |
False |
== |
equal to | 5 == 5 |
True |
!= |
not equal to | 5 != 3 |
True |
>= |
greater than or equal | 5 >= 5 |
True |
<= |
less than or equal | 5 <= 3 |
False |
Two equals signs compare, one equals sign assigns. age = 14 stores a value, age == 14 asks a question.
For the age age = 14, print five comparisons, each on a new line:
age > 10, age < 18, age == 14, age != 10, age >= 14.
A comparison is like a question: age > 10 returns True or False.
The five operators from the task: >, <, ==, !=, >=. The value of age
is already set — you don't need to write age = ..., and don't mix up = and ==.