AP CSP Topic 3.6: Conditionals | Big Idea 3 | APCSExamPrep.com

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

Topic 3.6: Conditionals

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

🎯 Learning Objectives

  • Write and trace if/else in Python and AP pseudocode
  • Predict which branch executes for given variable values
  • Identify errors that cause the wrong branch to run
  • Translate between Python and AP pseudocode conditional syntax
📈
Exam Impact: Conditionals are the foundation of algorithm design. They appear in nearly every BI3 MCQ and in Create Task rubric criteria.
💡 Why This Matters

A thermostat is a conditional: IF temperature < 68, turn on heater, ELSE turn off. Every decision-making program runs on this same two-branch structure.

If and If/Else

A conditional executes code only when a condition is true. The else branch runs when the condition is false.

grade = 74
if grade >= 70:
    print("Pass")
else:
    print("Fail")
grade <- 74
IF grade >= 70
{
 DISPLAY("Pass")
}
ELSE
{
 DISPLAY("Fail")
}

Tracing Conditionals

Evaluate the boolean condition with current variable values. Execute only the matching branch -- the other is skipped entirely.

Exam trap: Both branches in an if/else CANNOT both run. If the condition is true, else is skipped. If false, the if block is skipped.

Practice Problems

🔎 Practice MCQ
Given x = 8, what does this code print?
if x > 10:
    print("big")
else:
    print("small")
⚠️ Predict your answer BEFORE clicking.
🔎 Practice MCQ
Which code segments print "yes" when n = 5?
I. if n >= 5: print("yes")
II. if n != 5: print("yes")
III. if n < 10 and n > 0: print("yes")
⚠️ Predict your answer BEFORE clicking.
🔎 Practice MCQ
A student wants to print "discount" when age < 12 OR age >= 65. Their code prints it when age=40. Most likely error?
⚠️ Predict your answer BEFORE clicking.
🎮 Game
Conditional Branch Tracer
Pick what the code prints for the given value. 8 questions.
0
Correct
1/8
Question
0
Streak 🔥
🐛 Trace this code:
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 positive if n=7 > 0, else non-positive. Expected: positive
Hint: if n > 0: print('positive') else: print('non-positive')
Problem 2 of 3
Print pass if score=65 >= 60, else fail. Expected: pass
Hint: if score >= 60: print('pass') else: print('fail')
Problem 3 of 3
Spot the bug: should print even for n=4 but always prints odd.
if n % 2 == 1: print('even') else: print('odd')
Hint: Branch labels are swapped. Fix: if n%2==0: print('even') else: print('odd')

Frequently Asked Questions

If the condition is false and there is no else, no code runs -- the program continues to the next statement. This is valid and often intentional.
AP pseudocode uses IF condition { } ELSE { } with curly braces. Python uses indentation with a colon. Both branch on the same condition.
Yes -- that is a nested conditional or elif in Python. Topic 3.7 covers this. Only one path through all branches executes.
📦
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]