DSE ICT | Python Basics: a ten-section tutor guide (variables, loops, functions, debugging)
- 2026-11-05
Students follow an example but freeze at a blank file because they treat a program as syntax to memorise rather than a sequence of instructions. This lesson does one thing: take the sum from 1 to 10 and add variables, a loop and a function in turn, so the same task grows from three lines to ten and every change can be explained.
01 Prerequisites (3-minute check)
If any of these fails, fix it before the lesson starts.
| Skill | Quick check | Pass mark |
|---|---|---|
| Input and output | What do print and input do? | Print shows text, input collects a string |
| Data types | Why convert what input returns? | Input gives a string, so int is needed |
| Indentation | How does Python group instructions? | By indentation, usually four spaces |
02 Lesson flow (45 minutes)
| Time | Stage | Tutor does | Student does |
|---|---|---|---|
| 0-6 min | Read a broken program | Project a five-line sum that fails and ask students to find the faults | Students name at least one fault |
| 6-14 min | A variable is a box | Trace total equals total plus i turn by turn on the board | Students hand-write three rounds |
| 14-24 min | for and range | Explain why range of 1 to 11 stops at 10: start included, stop excluded | Students rewrite for 1 to 100 and check 5050 |
| 24-32 min | Wrap it in a function | Define total_to with a parameter and return; contrast return with print | Students wrap the sum and call it once |
| 32-40 min | Test and debug | Test with 1, 10 and 100, one of which fails deliberately | Students find and fix the failure |
| 40-45 min | Exit check | Collect three answers, read only | Work alone |
03 Teaching script (read it out)
Scene 1: Open with a broken program
The purpose is to show that programming is mostly fault finding, not writing from scratch. Once that is established, a blank file stops being frightening.
Students do: find the three faults and say what each one breaks.
Scene 2: Variables: boxes updated in turn
The common misreading is that total equals total plus i is an equation. Say clearly that the right side is evaluated first and the result is put back into the box. That wording lands better than the phrase assignment operator.
Students do: fill a ten-row table of i and total.
Scene 3: for and range: the stop is excluded
Then change the task from 1 to 10 into 1 to 100, whose answer is 5050, and let students press it themselves. Same task, different number: students see that the procedure matters, not the arithmetic.
Students do: rewrite for 1 to 100 and explain why 101 appears.
Scene 4: Wrap it in a function
Show print of total_to ten against assigning it to x: only the second can be used again. Once that is clear, students stop writing functions that are one long print statement.
Students do: rewrite the function for any n and verify n equals 10 gives 55.
Scene 5: Debug by breaking it on purpose
That deliberate failure shows why testing matters: a program tested only with 1 passes even when broken. This is usually the quietest, most focused ten minutes of the lesson.
Students do: find the gap between 45 and 55 and write its cause in one line.
04 Question types and worked steps
| Type | Example | Steps | Answer |
|---|---|---|---|
| Fill the blank | One line missing from a program | Trace the data flow before the syntax | Indentation and names both correct |
| Trace | Given a program and input, state the output | Write every variable value, one row per line | Include lines where nothing changes |
| Debug | One logical fault in the code | Test a small input first, then locate it | Name the line and the reason |
| Write | Produce a function from a description | Define input, processing and output | Has a return and a test value |
05 Independent practice (3 questions)
| Question | Answer | What to watch |
|---|---|---|
| Trace | Write the total after each round for 1 to 10 | Check rounds one, two and ten |
| Debug | Fix the 1 to 10 range and explain | Check the explanation mentions the excluded stop |
| Write | Write total_to for any n and test 100 | Check it returns 5050 |
06 Common mistakes and what to say
| Mistake | Student writes | Say this |
|---|---|---|
| Total never initialised | Writing total equals total plus i straight away | “Total does not exist in round one. Give it a zero first.” |
| Wrong stop in range | Writing 1 to 10 and losing the final value | “Your answer is 10 short. The stop is excluded, so write 11.” |
| Print instead of return | A function that only prints, so nothing comes back | “Print shows, return hands over. Which one does the caller need?” |
| Inconsistent indentation | One line at four spaces and the next at two | “These look alike but Python reads them as different blocks. Line them up.” |
07 Homework (paper, section and question numbers)
- Redo this chapter — All three practice items with test values
- ICT index — Other chapters and question types
- All prep guides — The same ten sections across subjects
08 Exit check (last 5 minutes)
| Question | Answer | Decision |
|---|---|---|
| Updating a variable | Right side first, then the box | Cannot state it, redo act two |
| range boundaries | Start included, stop excluded | Boundary wrong, redo act three |
| return versus print | Return hands back, print shows | Confused, redo act four |
09 Tutor FAQ
Must students memorise syntax?
No. Recognise four shapes: assignment, for, def and return.
Which Python version?
Python 3 style; the exam does not demand a version, but input must be converted.
What if they cannot start?
Write three steps in plain words first: input, processing, output, then translate line by line.
Find a tutor — freeTutor Registration →
A TutorZone lesson-prep guide. Written by the TutorZone team; questions and lesson flow are original and are not taken from any school or publisher material.


