Codecademy Logo

Learn How to Code with Blockly: If Statements

Related learning

  • Want to learn how to get started with programming in an interactive way? Try our drag and drop code lessons!
    • Beginner Friendly.
      2 hours

AND Operator

In programming, the logical AND operator (&&) compares two values. It returns true when both values evaluate to true and false otherwise.

The following evaluates to true: grass is green AND fire is red 2 > 1 AND 6 > 5 3 == 3 AND 8 == 8

While this evaluates to false: trees are large AND ant are massive 5 < 4 AND 6 > 3 7 == 7 AND 0 == 9

Learn more on Codecademy

  • Want to learn how to get started with programming in an interactive way? Try our drag and drop code lessons!
    • Beginner Friendly.
      2 hours