Study guides & original practice
Boolean logic practice
Boolean expressions evaluate to true or false. AND requires both operands to be true; OR requires at least one; NOT reverses a Boolean value.
By ExamCat · Original study lesson · Published September 24, 2026
Understand the method
Use parentheses to make grouping explicit rather than relying on language-specific precedence. Inclusive OR is true when both inputs are true. Exclusive OR, usually called XOR, is true when exactly one is true.
Worked example, step by step
Evaluate (A OR B) AND NOT C when A is false, B is true and C is false.
- A OR B is true because B is true.
- NOT C is true because C is false.
- The expression becomes true AND true.
- The final result is true. Changing C to true would make the result false without changing A or B.
A mistake to watch for
Natural-language “or” can sound exclusive, but Boolean OR is ordinarily inclusive. Distinguish a variable assignment from a comparison in actual code; their syntax differs by language.
Try it yourself: three questions
Write an answer before opening the explanation. For calculations, keep your units and intermediate steps; for concepts, state the reason for your choice.
1. What is true AND false?
Show answer and explanation
False. AND needs both inputs to be true.
2. What is NOT (true OR false)?
Show answer and explanation
False. Evaluate the parentheses first, then reverse the result.
3. Are NOT (A AND B) and (NOT A) OR (NOT B) equivalent?
Show answer and explanation
Yes. Each is false only when both A and B are true. Checking all four input combinations verifies this De Morgan relationship.
Build your next practice session
Mark the first step where your reasoning differed from the explanation. Turn that step into a question, answer it without looking, then change one condition in the example and explain what would change. A correct guess is a reason to revisit the method.
Use the free flashcard maker for your own question-and-answer pairs, or bring your course material into PDF-to-flashcards practice.
Further reading
OpenStax: data structures and algorithms provides textbook background. The worked scenario and practice questions on this page were written independently for ExamCat.
Related lessons
Practice your own class material
Generate flashcards, notes and quizzes from your lecture notes in Exam Cat.
Try 7 days free ↗Yearly plan: 7 days free, then $39.99/year. Cancel before the trial ends to avoid a charge.
APUSH study guide · Biology study guide · APUSH practice · All study tools
