Click here to navigate the course.

Drag the edges to resize the window.

In Projects, you can keep track of your progress as you go throught the tasks. Check each item as you complete it!

Code Editor
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.