Control flow

Comparison Operators

if/else statements are made even more powerful 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: >=

Comparisons need two things to compare and they will always return a boolean (true or false).

How can we use comparisons and an if/else statement to see if it's time to eat?

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.