Skip to content
Computing · Year 8

Active learning ideas

Selection: If, Elif, Else

Active learning works well here because conditional logic is best understood through immediate feedback and debugging. Students need to see how tiny changes affect program flow, which is hard to grasp from reading alone. Pairing and group work let them test predictions, correct mistakes, and build confidence with real code outcomes.

National Curriculum Attainment TargetsKS3: Computing - Programming and DevelopmentKS3: Computing - Control Structures
20–45 minPairs → Whole Class4 activities

Activity 01

Escape Room30 min · Pairs

Pair Programming: Quiz Grader

Pairs write a program that takes a quiz score input and uses if-elif-else to output grades: A for 90+, B for 80-89, etc. They test with various scores, then swap to improve each other's code. End with pairs presenting one edge case.

Design a program that uses selection to provide different responses based on user input.

Facilitation TipDuring Pair Programming: Quiz Grader, circulate and ask each pair to verbalize the condition they are testing before they run the code.

What to look forProvide students with a simple scenario, e.g., 'A program needs to tell a user if they are old enough to drive (17+).'. Ask them to write the Python code using an if-else statement and explain in one sentence why the else part is important.

RememberApplyAnalyzeRelationship SkillsSelf-Management
Generate Complete Lesson

Activity 02

Escape Room45 min · Small Groups

Small Groups: Nested Decision Trees

Groups build a text adventure game with nested if statements for choices like 'left' or 'right' paths, including elif for invalid inputs. They run simulations, record paths taken, and refine for better user experience.

Evaluate the importance of logical conditions in controlling program flow.

Facilitation TipFor Small Groups: Nested Decision Trees, provide a blank flowchart template so students can map logic before coding.

What to look forPresent students with a short Python code snippet containing an if-elif-else structure. Ask them to predict the output for a given input value and explain their reasoning, focusing on how the conditions are evaluated sequentially.

RememberApplyAnalyzeRelationship SkillsSelf-Management
Generate Complete Lesson

Activity 03

Escape Room20 min · Whole Class

Whole Class: Code Critique Relay

Project student code snippets with selection errors on the board. Class votes on fixes in a relay: one student suggests indentation change, next tests condition logic. Discuss as a group why the code now works.

Analyze how nested selection statements mirror complex human decision-making.

Facilitation TipIn the Whole Class: Code Critique Relay, rotate roles every five minutes to keep all students engaged in spotting and fixing errors.

What to look forPose the question: 'When might you need to use an elif statement instead of just multiple if statements?'. Encourage students to discuss scenarios where only one of several conditions should be met and explain the potential issues with using only separate if statements.

RememberApplyAnalyzeRelationship SkillsSelf-Management
Generate Complete Lesson

Activity 04

Escape Room25 min · Individual

Individual: Condition Challenges

Students complete worksheets with buggy code blocks using if-elif-else, such as sorting numbers into categories. They predict outputs, code fixes, and verify by running in Python.

Design a program that uses selection to provide different responses based on user input.

Facilitation TipFor Individual: Condition Challenges, give students five minutes to annotate the code with expected outputs before attempting to run it.

What to look forProvide students with a simple scenario, e.g., 'A program needs to tell a user if they are old enough to drive (17+).'. Ask them to write the Python code using an if-else statement and explain in one sentence why the else part is important.

RememberApplyAnalyzeRelationship SkillsSelf-Management
Generate Complete Lesson

A few notes on teaching this unit

Teach conditionals as a conversation between program and user. Start with a single if-else to build trust in the structure, then introduce elif as a way to narrow choices, not add more ifs. Emphasize tracing: students should read code aloud like a story, predicting outcomes before executing. Avoid rushing to complex examples; mastering simple chains first prevents later confusion with nested logic.

Students will confidently write if-elif-else chains that match inputs to expected outputs. They will trace conditions step-by-step, explaining why only one branch runs and how indentation controls execution. Programs will run without syntax errors and produce predictable results for varied inputs.


Watch Out for These Misconceptions

  • During Pair Programming: Quiz Grader, students often assume each elif opens a new branch, leading to multiple prints. Watch for pairs who test inputs that should satisfy only one condition.

    Ask pairs to trace their code on paper first, drawing arrows to show which branch runs for each input before they run it.

  • During Whole Class: Code Critique Relay, students forget colons or misalign indentation, treating errors as logic mistakes. Watch for groups who skip syntax fixes and focus only on changing conditions.

    Set a three-minute timer for syntax-only debugging rounds where teams fix indentation and colons before discussing logic.

  • During Small Groups: Nested Decision Trees, students default to == in all conditions, including ranges. Watch for groups who write if score == 50 instead of if score >= 50.

    Display a list of operators on the board and ask each group to justify their choice in one sentence before coding.


Methods used in this brief