AP CSP Topic 3.5: Boolean Expressions | Big Idea 3 | APCSExamPrep.com

AP CSP Course Big Idea 3 Topic 3.5: Boolean Expressions
🎓54.5% score 5s vs 9.6% nationally
5.0 Wyzant — 451+ reviews
📍Blue Valley North, Overland Park KS
3.5
AP CSP — Big Idea 3: Algorithms & Programming
CED Aligned • Exam Ready

Topic 3.5: Boolean Expressions

🎓 High School AP
💻 Python + AP Pseudocode
🎯 30-35% Exam Weight
📚 Interactive Lesson

🎯 Learning Objectives

  • Evaluate AND, OR, NOT using truth tables
  • Apply relational operators correctly
  • Predict boolean results of compound expressions
  • Identify common boolean logic errors in code
📈
Exam Impact: Boolean expressions appear in every conditional and loop -- they underpin the majority of BI3 MCQ questions.
💡 Why This Matters

Can you take out a library book? Rule: you must have a library card AND NOT have overdue fines. That's a boolean expression. Programming conditions work exactly the same way.

Relational and Logical Operators

Boolean expressions combine relational operators (comparing values) with logical operators (combining conditions). They evaluate to true or false.

x = 7
print(x > 5)               # True
print(x == 10)             # False
print(x > 5 and x < 10)    # True
print(x < 5 or x > 6)      # True
print(not x == 7)          # False
x <- 7
DISPLAY(x > 5)             {true}
DISPLAY(x = 10)            {false}
DISPLAY(x>5 AND x<10)      {true}
DISPLAY(x<5 OR x>6)        {true}
DISPLAY(NOT(x = 7))        {false}

Truth Table Rules

AND: true only when BOTH sides are true.
OR: true when AT LEAST ONE side is true.
NOT: flips the value.

Exam trap: OR is inclusive. true OR true = true. Students sometimes assume it means “either/or but not both.” It doesn’t.

Practice Problems

🔎 Practice MCQ
What is the value of (3 > 5) OR (10 > 7)?
⚠️ Predict your answer BEFORE clicking.
🔎 Practice MCQ
Which expressions are FALSE when score = 72?
I. score >= 70 AND score <= 80
II. score > 80 OR score < 60
III. NOT(score == 72)
⚠️ Predict your answer BEFORE clicking.
🔎 Practice MCQ
A gate opens if a person is a member OR holds a day pass, AND is NOT banned. Correct expression?
⚠️ Predict your answer BEFORE clicking.
🎮 Game
Boolean Evaluator
Evaluate each boolean expression to true or false. 8 questions.
0
Correct
1/8
Question
0
Streak 🔥
🤔 Evaluate:
0/8
correct
💻 Python Code Editor
Practice Problems
Write Python and check your answer. Paste into Replit for complex programs.
Problem 1 of 3
Print True if x=15 is between 10 and 20 inclusive. Expected: True
Hint: print(x >= 10 and x <= 20)
Problem 2 of 3
Print True if n=7 is NOT equal to 0. Expected: True
Hint: print(n != 0)
Problem 3 of 3
Spot the error: should print True when score>=60 OR grade=='pass'. score=55, grade='pass'.
print(score >= 60 and grade == 'pass')
Hint: Change 'and' to 'or'. With OR, either condition being true makes the whole expression true.

Frequently Asked Questions

In everyday English 'or' often means exclusive-or (one or the other, not both). In computer science OR is inclusive: true if at least one side is true, including when both are true.
NOT binds tightest, then AND, then OR -- similar to multiplication before addition. Use parentheses to make compound expressions unambiguous.
Yes. done = False, then done = True when a task completes. Check with if done: later. Common in loops and state flags.
📦
AP CSP Teacher SuperpackSlides, lesson plans, unit tests for all 5 Big Ideas — $249
Get the Superpack →

Get in Touch

Whether you're a student, parent, or teacher — I'd love to hear from you.

Just want free AP CS resources?

Enter your email below and check the subscribe box — no message needed. Students get daily practice questions and study tips. Teachers get curriculum resources and teaching strategies.

Typically responds within 24 hours

Message Sent!

Thanks for reaching out. I'll get back to you within 24 hours.

🏫 Welcome, fellow educator!

I offer curriculum resources, practice materials, and study guides designed for AP CS teachers. Let me know what you're looking for — whether it's classroom materials, a guest speaker, or Teachers Pay Teachers resources.

Email

[email protected]

📚

Courses

AP CSA, CSP, & Cybersecurity

Response Time

Within 24 hours

Prefer email? Reach me directly at [email protected]