14

Lesson 14 of 20 ยท Logic & Boolean Expressions

Logic & Boolean Expressions โ€” Part 3

True, false, AND, OR, NOT. This is part 3 of 20.

What you'll learn

You will learn that comparisons produce True or False (booleans), and these power every decision in code.

Steps

  1. 1Computers think in True and False. a > 3 asks 'is 5 greater than 3?' โ€” yes, so it's True.
  2. 2a > 10 asks 'is 5 greater than 10?' โ€” no, so it's False. These True/False values are called booleans.
  3. 3Other comparisons: == (equal?), != (not equal?), < (less than?), >= (greater or equal?). They all give True or False.
  4. 4Booleans power every decision in code. Every 'if' statement checks a boolean. Every game checks: is the player alive? True or False!

Key Terms

Boolean
A value that is either True or False.
Compare
Checking how two values relate: equal (==), greater (>), less (<).
Condition
Something that is true or false. Programs use conditions to make decisions.
Python 3
Output
Loading Python... This may take a few seconds.

Your code runs only in your browser. No code is sent to any server. Stay safe and have fun learning!

๐Ÿ–จ๏ธ

Checkout complete lesson on Logic & Boolean Expressions for 7th Grade

Get the full Logic & Boolean Expressions track as a printable PDF โ€” all lessons, worksheets, and answer keys.

View in Shop

Your Cart (0)

Your cart is empty

Browse our shop to find activities your kids will love

Logic & Boolean Expressions โ€” Part 3 โ€” Logic & Boolean Expressions | 7th Grade Coding | LittleActivity | LittleActivity