🌐All 78 Curricula
🎓
Learner● Active
⚙️Admin
CSTA.2-AP-12Ontario Ministry of Education AlignedAcademic Year 2026–27

Conditionals, Boolean Logic & Branching Decision Trees

Implement logical decision branches in software using if, elif, else statements and Boolean operators (and, or, not).

Why It Matters:Every interactive application, video game collision system, and cybersecurity access gateway relies on conditional logic.

Curated Video Instruction

● Verified Active Embed
Resource:★ Primaryby CrashCourse
YouTube ↗

Boolean Logic & Logic Gates: Crash Course Computer Science #3

Curated masterclass for Conditionals, Boolean Logic & Branching Decision Trees aligned with CSTA.2-AP-12.

Rating:96/100
STEP-BY-STEP PROOF

Worked Example

Construct a conditional statement to grant discount if age is under 12 OR over 65:
1
Define Boolean conditional test
is_discounted = (age < 12) or (age > 65)
The "or" operator evaluates True if either condition is satisfied.
2
Write if-else branch
if is_discounted: price = 5.0 else: price = 12.0
Executes discount branch if True, standard rate if False.
Verification Check

Test age = 70: 70 > 65 is True -> price = 5.0.

is_discounted = True
Price = $5.0 (Verified)

⚠️ Common Pitfalls & Misconceptions

Using single equals = instead of comparison operator ==
Writing: if score = 100:Use == for comparison: if score == 100: (= is for variable assignment)

= assigns a value; == tests for equality.

INTERACTIVE DRILLS

Guided Practice

Practice Question1 of 1
Step-by-step Feedback

What does the expression (True and False) evaluate to in Python?

MASTERY BENCHMARK

Official Assessment Quiz

Formal Assessment

Conditionals, Boolean Logic & Branching Decision Trees

Passing Criteria:70% or higher
Question 1 of 1

What Python keyword is used to check an additional condition if the initial "if" test was False?

Education to Career Navigation

Where This Lesson Leads

Game Developers and Cybersecurity Engineers program access rules using conditional algorithms.

View Pathways →Explore Universities