Studyfin Studyfin ✨ Sign up free

Boolean logic (AND, OR, NOT)

Grade 7 · Coding · Free lesson

Hey there! Ready to learn how computers make smart decisions? Let's explore Boolean logic together!

Computers do not think like humans do. They use simple True and False values, which we call Boolean data, to make choices.

xor

The AND operator is like a strict rule. It only outputs True if both inputs are True at the same time.

The AND Gate (Both must be True)TRUETRUEANDY

The OR operator is much more relaxed. It outputs True if at least one of the inputs is True.

The OR Gate (One or More True)TRUEFALSEORY

The NOT operator is a simple flipper. It takes whatever you give it and turns it into the exact opposite.

The NOT Gate (The Flipper)TRUENOTFALSE
✏️ Worked example

Let's analyze this real-world puzzle: You can go to the park if 'It is sunny' AND 'You finished your homework'. Today, it is sunny, but you did not finish your homework. Can you go to the park?

  1. Identify the first input: 'It is sunny'. Since it is sunny today, this input is True.
  2. Identify the second input: 'You finished your homework'. Since you did not finish it, this input is False.
  3. Look at the operator connecting them, which is AND.
  4. Recall the rule for AND: both inputs must be True to get a True output.
  5. Combine the values: True AND False equals False. You cannot go to the park yet!
kids
Want the full interactive lesson — quiz, animations, and Finn cheering them on?

More Coding lessons