Home›Lesson Plans›Computer Science›Programming · Grade 9

Conditionals

Ninth graders use if / elif / else to make a program choose a path. Python checks the conditions top to bottom and runs the FIRST one that is true. They order a grade-checker, then build a branching program of their own.

Grade 9Conditionals (if / elif / else)55 minutes1 class periodCSTA / ISTEExplicit teaching4 StandardsCSTA
Start the Lesson
Assign or share this lesson

Copy link works with Canvas, Schoology, Moodle and any other LMS — paste it in as a resource or assignment.

Lesson at a Glance

Everything you need before the bell rings

Learning Objectives

Students will be able to…

  • ✓Write if / elif / else.
  • ✓See conditions checked top to bottom.
  • ✓Know only the first true branch runs.
  • ✓Build a decision program.
Essential Question

How does a program choose between several paths?

0
Lesson Phases
0
Vocabulary Terms
0
Standards Aligned
0
Interactive Task
Put in Order · Interactive

Order the Grade-Checker

Project this and have students put the if / elif / else branches in the order Python checks them.

🔀 Put the branches in the order Python checks themTry it
Tap the first condition Python checks!
The Lesson · Use → Modify → Create (a coding progression with Unplugged practice)

55 minutes, five moves

Tap any phase to open the teacher moves and student actions.

1

Hook — Which Path?

6 min

How could a program turn a score into a letter grade?

👩‍🏫 Teacher Moves

  • Show a score and ask the grade.
  • Ask how to choose.
  • Set the goal.

🎒 Student Actions

  • Think.
  • Guess.
  • Get ready.
2

Use — Conditionals

13 min

Students use conditionals.

👩‍🏫 Teacher Moves

  • Send students to Order the Grade-Checker.
  • Order the branches.
  • Note top-to-bottom, first-true-wins.

🎒 Student Actions

  • Order.
  • Say.
  • Note it.
3

Modify — Reorder & Test

14 min

Students modify.

👩‍🏫 Teacher Moves

  • Swap two branch thresholds.
  • Predict a new result.
  • Test with a score.

🎒 Student Actions

  • Swap.
  • Predict.
  • Test.
4

Create — Build a Brancher

15 min

Students create.

👩‍🏫 Teacher Moves

  • Write an if/elif/else (e.g. ticket price by age).
  • Add an else for all other cases.
  • Test 3 inputs.

🎒 Student Actions

  • Write.
  • Add.
  • Test.
5

Reflect — Reflect

7 min

Students close.

👩‍🏫 Teacher Moves

  • Say the order conditions are checked.
  • Say which branch runs.
  • Complete the exit ticket.

🎒 Student Actions

  • Say it.
  • Say.
  • Complete the exit ticket.
Standards Alignment

Built to the standards you report on

Aligned to the CSTA K-12 Computer Science Standards and the ISTE Standards for Students.

CSTA
3A-AP-15

Iteratively develop programs using conditionals.

CSTA
3A-AP-16

Combine control structures to express ideas in code.

CSTA
3A-AP-21

Evaluate and refine computational artifacts.

ISTE
5 Computational Thinker

Use logic to build solutions.

Differentiation

One lesson, every learner

Multilingual Learners

ELL / EMERGING READERS
  • Flowchart the branches.
  • Frame: if-then-otherwise.
  • Trace with sample scores.

Support & Access

IEP / 504
  • Use if/else only (2 paths).
  • One threshold to start.
  • Use a number line.

Stretch & Extend

GIFTED / EARLY FINISHERS
  • Add nested conditionals.
  • Use AND/OR in a condition.
  • Handle edge cases.
Materials

What to gather

  • 📽️Screen / board
  • 🔀Branch cards
  • 💻Order the Grade-Checker
  • 🐍Python / editor
  • 📓Notebooks
  • 🎫Exit-ticket slips
Vocabulary

Key terms — hover for a quick definition

conditionalcode that chooses a pathifruns a block when its test is trueelifelse-if: checked only if earlier tests failelseruns when no earlier test was trueconditiona test that is true or falsebranchone possible path through the codeevaluateto work out true or falsetop to bottomthe order Python checks conditions
Evaluate

Exit Ticket

Preview the three formative checks. Tap “Sample answer” to see what mastery looks like — hide them before you print for students.

QUESTION 1
In what order does Python check if/elif/else?
Top to bottom.
QUESTION 2
Which branch runs?
The first one whose condition is true.
QUESTION 3
What does "else" do?
Runs when no earlier condition was true.

Reflect: conditionals.

Have students write a 3-branch if/elif/else for a real decision. A printable conditionals worksheet is in the Computer Science library.

Study · Flashcards

Study the key terms

Tap a card to flip it, then rate whether you knew it. Built from this lesson’s vocabulary.

🃏 CS Conditionals (Grade 9)Flip
Card 1
Term
Tap to flip →
Meaning
0

Nice work!

Practice · Quiz

Check your understanding

A quick self-check with instant feedback, drawn from this lesson’s key terms.

📝 CS Conditionals (Grade 9)Quiz
Score: 0
1 / 6
Question 1
0%

Nice work!

Practice · Worksheet

Printable worksheet

A print-and-go review sheet with a built-in answer key. Tap “Show answer key” to reveal answers, or print the clean version for students.

🖨️ CS Conditionals (Grade 9)Print
Name: ________________________
Date: ____________

Part A · Write the word that matches each meaning

Word bank: branch, condition, conditional, elif, else, evaluate, if, top to bottom
  1. runs a block when its test is true
  2. else-if: checked only if earlier tests fail
  3. code that chooses a path
  4. a test that is true or false
  5. to work out true or false
  6. runs when no earlier test was true
  7. one possible path through the code
  8. the order Python checks conditions

Part B · Show what you learned

  1. In what order does Python check if/elif/else?
  2. Which branch runs?
  3. What does "else" do?
Answer key — Part A: 1) if · 2) elif · 3) conditional · 4) condition · 5) evaluate · 6) else · 7) branch · 8) top to bottom
Part B: 1) Top to bottom. 2) The first one whose condition is true. 3) Runs when no earlier condition was true.