Control Flow

Comparison Operators

In addition to checking whether a variable evaluates to true or false, sometimes we need to compare variables to other values. We can achieve this with comparison operators.

There are two comparisons you might be familiar with:

  • Less than: <
  • Greater than: >

You may also recognize these:

  • Less than or equal to: <=
  • Greater than or equal to: >=

These comparisons evaluate to true or false.

Community Forums
Get help and ask questions in the Codecademy Forums
Report a Bug
If you see a bug or any other issue with this page, please report it here.