Learn

We often want to check if a value is above or below a certain amount. We check the relation of one value to another.

These kinds of conditions are known as relational operators. Languages typically use symbols from mathematics:

  • For less than: <
  • For less than or equal to: <=
  • For greater than: >
  • For greater than or equal to: >=

For example, if you go to the doctor and the nurse takes your temperature:

Take patient's temperature If (body temperature is > 99) { Alert doctor to fever } Send in doctor

We can use relational operators to check whether values are higher or lower than each other. With Codey, we will compare their horizontal and vertical positions.

Instructions

Placeholder instructions

Take this course for free

Mini Info Outline Icon
By signing up for Codecademy, you agree to Codecademy's Terms of Service & Privacy Policy.

Or sign up using:

Already have an account?