Give

Decisions with if

Use if, elif and else so a program makes choices.

Planned. This module is part of the plan and is not written yet.

COCO-PRG-PYB-0505Level8–10

Why it matters

The Lantern's free public Wi-Fi gives each device a daily time allowance. A program decides with if whether a device still has time left.

Draft outline · in review
For
Level 8–10 · JSS 2 to SSS 1
Inside
5 lessons and a test · about 75 minutes
Topic
Python basics · core, 2 of 4
Plate CO-PRG-PYB-05: planned.

Inside the module.

5 lessons in order, about 75 minutes in all, then a short test. Learners go at their own pace; the minutes are a guide, not a timetable.

Draft outline · in review

  1. Lesson 1: if, elif and else

    How Python chooses one branch, and why indentation matters.

    Explain15 min, from minute 0

  2. Lesson 2: Grading a score

    Turn a test score into a grade with if, elif and else.

    Worked example15 min, from minute 15

  3. Lesson 3: and, or, not

    Combine conditions: a learner may enter if it is a school day and they have registered.

    Practice20 min, from minute 30

  4. Lesson 4: Wi-Fi time checker

    Tell a user how many minutes they have left, or that their time is up.

    Project20 min, from minute 50

  5. Lesson 5: Check your skills

    Predict which branch runs.

    Review5 min, from minute 70

  6. End-of-module test

    Write programs that make choices with if, elif and else, using combined conditions where needed.

    Mastered at 85% or more. Retake it until you pass; nothing is lost, and each try gives feedback.

    Already know it? A Challenge Test (planned) clears the whole module: 90% overall, no objective below 75%.

    Last stageafter about 75 min

Practicalities

Draft outline · in review
  • Built to run offline

    Planned to run on the Lantern's own computer, with no internet needed.

  • Languages

    Planned first in English; every module aims to reach all of the Lantern's languages.

Try a question.

One question from the module, as a learner would meet it. Have a go, then open the worked solution a step at a time.

Draft outline · in review

What does this print? minutes = 45 if minutes >= 60: print("Time is up") elif minutes >= 40: print("Nearly done") else: print("Keep going")

Work it out on paper first, then show the answer and mark it yourself.

Particulars

What a learner can do after it

  1. Write if, elif and else statements.
  2. Combine conditions with and, or and not.

Level

Level 8–10 · JSS 2 to SSS 1

Show levels in

Level mappings are approximate. A qualified teacher or lecturer in each country must check them before they appear in the app.

Difficulty for its level

2 of 4 · Core

Time

About 75 minutes

Alignments

  • Aligned to PCEPpartial · in reviewPCEP: conditional statements (descriptive ref)

Alignment in review until a qualified teacher or lecturer checks it. No exam body, university or vendor endorses us; learners still sit the real exam.

Challenge Test

Planned: a Challenge Test to prove you know it and skip it. Pass at 90% overall, with no objective below 75%.

University courses it previews

Computer Science, Software Engineering

The route here.

Everything this module builds on, drawn as a route from its foundations. Solid lanes must be mastered first, or cleared by a Challenge Test; dashed lanes are suggestions that never lock anything.

  1. CO-BLK-SEQ-01Instructions in orderCoding · Primary 1 to Primary 4 (Level 1–4) · Planned
  2. CO-BLK-LOP-01Repeat blocksCoding · Primary 3 to Primary 5 (Level 3–5) · Sample lesson in the demo Needs Instructions in order (required).Try the sample lesson: Repeat blocks
  3. DS-CMP-TYP-01The home rowDigital skills · Primary 3 to Primary 6 (Level 3–6) · Planned · recommended
  4. CO-BLK-CND-01If this, then thatCoding · Primary 3 to Primary 6 (Level 3–6) · Planned · recommended
  5. CO-BLK-LOP-02Patterns with loopsCoding · Primary 4 to Primary 6 (Level 4–6) · Planned Needs Repeat blocks (required).
  6. MA-ARI-ORD-01Order of operationsMaths · Primary 5 to Primary 6 (Level 5–6) · Planned · recommended
  7. CO-PRG-PYB-01Your first Python programCoding · JSS 1 to JSS 3 (BECE) (Level 7–9) · Planned Needs Patterns with loops (required), The home row (recommended).
  8. CO-PRG-PYB-02VariablesCoding · JSS 1 to JSS 3 (BECE) (Level 7–9) · Sample lesson in the demo Needs Your first Python program (required).Try the sample lesson: Variables
  9. CO-PRG-PYB-03Numbers and calculationsCoding · JSS 1 to JSS 3 (BECE) (Level 7–9) · Planned Needs Variables (required), Order of operations (recommended).
  10. CO-PRG-PYB-05Decisions with ifCoding · JSS 2 to SSS 1 (Level 8–10) · Planned · the destination Needs Numbers and calculations (required), If this, then that (recommended).
10 stops across Coding, Digital skills and Maths. 2 have a sample lesson in the demo; the other 8 are planned and not yet written.

Help light the room where this is learned.

Every route on this map starts in a classroom with 24 stations, a tutor that works offline and a facilitator upstairs. Four are planned and waiting for light.