This Top 100 Secondary 3 G3 vocabulary list helps Punggol students understand algorithms and programming: what a problem asks, how instructions process data, and why a program produces a particular result. The terms cover variables, conditions, loops, strings, lists, functions, validation and debugging. Each entry gives a plain-language meaning and an example, followed by worked exercises that connect the vocabulary to decisions a student must make while reading or writing code.
Begin with the topics your school is teaching. Learn ten terms at a time, explain a short example without looking at the answer, and trace changing values on paper before running the program. This is an original teaching selection, not an official MOE or SEAB Top 100 list. It uses the 2027 G3 Computing syllabus as its reference; the syllabus-year and subject-level notes below help parents check whether the material matches their child’s course.
- Know the task: identify the required inputs, processing and outputs before writing code.
- Use the words accurately: assignment, equality, parameters and arguments describe different operations.
- Trace the program: record each relevant variable after the stated instruction or loop iteration.
- Test deliberately: choose normal, boundary and invalid inputs, with expected results decided in advance.
- Check the course: the 2027 G3 reference is Computing K349; G2 Computing has a separate syllabus.
- Follow the school sequence: an unfamiliar upper-secondary topic can remain a preview until it is taught.
Find your next learning step
Choose the part that matches the schoolwork in front of you. Every teaching section remains open below.
Check the subject, examination year and school sequence.Learn the 100 terms
Use the meanings and examples with current schoolwork.Work through examples
Connect the words to explanations, evidence and clear answers.Check and practise
Try the questions, then review the explained answers.Plan support
Choose a routine and questions to ask a teacher or tutor.
Article contents
Start with the course
The 100 vocabulary entries
- 1–10: Understanding the problem
- 11–20: Reading the building blocks of a program
- 21–30: Values, types and arithmetic
- 31–40: Choosing the correct path
- 41–50: Repeating instructions without losing track
- 51–60: Working with text and ordered collections
- 61–70: Associating data and organising reusable work
- 71–80: Recognising useful algorithm patterns
- 81–90: Checking data and planning tests
- 91–100: Explaining errors and improving a solution
Worked learning, practice and support
- Worked example: filter, accumulate and calculate a mean
- Worked example: choose a safe starting value
- Resolve the confusions that change program behaviour
- Plan validation with evidence, not guesswork
- Eight diagnostic questions with explained answers
- A four-week routine that links vocabulary to performance
- What parents can look for before choosing the next support
Sources checked on 16 November 2026. The 2027 SEAB G3 index identifies Computing as K349. Its official syllabus includes Algorithms and Programming alongside Computing Fundamentals, Spreadsheets, Networking and Impact of Computing. This article concentrates on programming language and reasoning. It does not cover every outcome in the subject. For example, file handling and several string operations require further practice beyond the examples here.
The 2027 G2 index lists Computing K237 separately. Families should check the subject level and syllabus code on school information before applying course requirements. A child following the usual two-year upper-secondary route from Secondary 3 in 2026 would normally work towards the 2027 examination; a child starting Secondary 3 in 2027 should check the relevant 2028 documents. The 2027 sources used here do not establish the requirements of a later examination year.
The course syllabus is not a week-by-week Secondary 3 timetable. Match these groups to your teacher’s current unit and school assessment scope. Students who have not reached dictionaries or functions can concentrate on inputs, variables, selection and loops first. The extra terms become a preview, rather than evidence that the student is behind.
A useful vocabulary check has three parts: explain the term, identify it in an unfamiliar example, and describe what changes when it is used incorrectly. For example, knowing the word accumulator should help a student explain why a total starts before a loop and is updated inside it. Copying a definition alone does not demonstrate that understanding.
These words help turn a story into a precise task. Before choosing any Python command, say what information enters the program, what the program must produce, and which details do not affect the answer.
| No. | Term | Meaning | Example and use |
|---|---|---|---|
| 1 | Problem specification | A precise description of the task, including its inputs, required outputs and rules that a correct solution must satisfy. | For a reading challenge, specify whether the program counts books completed this week or all books ever recorded. |
| 2 | Requirement | A particular condition the solution must meet. Requirements describe the needed behaviour and constraints, rather than merely suggesting how the code might look. | If only whole-number scores from zero to one hundred are accepted, both the type and permitted range matter. |
| 3 | Input | Data supplied to a program for processing. It may come from a person, a file or another source. | A learner enters the number of pages read. The typed characters are input; the calculated weekly total is not. |
| 4 | Output | Information a program produces for a user or another destination after carrying out instructions. | A message displaying the number of qualifying entries is output. Decide its wording and value before testing the solution. |
| 5 | Processing | The operations that transform or examine input to produce the required result, such as calculating, comparing and selecting. | Add seven daily reading amounts, then compare the total with a target. Those operations perform the processing. |
| 6 | Algorithm | A clear sequence of steps for solving a specified problem. The steps should be precise enough to follow consistently. | To find the greatest score, remember the first score, inspect each remaining score, and replace the remembered value when appropriate. |
| 7 | Abstraction | Keeping the details that matter for a particular problem while setting aside details that do not affect its solution. | A program calculating reading duration needs start and end times. The colour of the book cover is irrelevant to that calculation. |
| 8 | Decomposition | Breaking a larger problem into smaller parts that can be understood and solved separately, then combined. | Separate a class survey program into collecting responses, checking them, calculating totals and displaying the results clearly. |
| 9 | Pseudocode | A written description of an algorithm using structured, readable instructions without requiring the exact syntax of a particular programming language. | “FOR each score, add it to total” expresses a step. Python needs its own valid punctuation and indentation when implemented. |
| 10 | Flowchart | A diagram that uses connected symbols and arrows to show the order of operations and possible paths through an algorithm. | At a decision labelled “score at least 50?”, follow the appropriate branch rather than carrying out both branches automatically. |
Read symbols as actions, not decoration. In particular, a program executes instructions in order, and an assignment changes the value associated with a name. An expression can be evaluated without itself being a complete task description.
| No. | Term | Meaning | Example and use |
|---|---|---|---|
| 11 | Program | Instructions written in a form that a computer can execute to carry out a task. | A program may implement an algorithm, ask for data and display a result. It still needs testing against the original requirements. |
| 12 | Source code | The human-readable instructions written in a programming language before or while they are processed for execution. | The Python statements you type are source code. A screenshot of the final answer does not show how that answer was produced. |
| 13 | Syntax | The rules governing how valid instructions are written in a language, including required symbols and structure. | Python requires a colon after an if condition. A sensible idea can still fail when its written syntax is invalid. |
| 14 | Statement | An instruction or syntactic unit in a program that performs an action, such as assignment or selection. | The statement total = 0 assigns a starting value. Do not assume every physical line always represents one complete statement. |
| 15 | Expression | A combination of values, names and operations that can be evaluated to obtain a value. | If count is 4, the expression count + 3 evaluates to 7. That calculation does not change count by itself. |
| 16 | Variable | A name used to refer to a value during program execution; assigning to the name can change what it refers to. | After points = 6, points refers to 6. After points = points + 2, it refers to 8. |
| 17 | Identifier | A name used to identify something in code, such as a variable or function, following the language’s naming rules. | In Python, book_count is a usable identifier; 3books cannot be one because it begins with a digit. |
| 18 | Literal | A value represented directly in source code, rather than obtained by looking up a variable name. | In pages = 24, the number 24 is a literal. In label = “Ready”, the quoted text is a string literal. |
| 19 | Assignment | The operation that associates a variable name with the result of an expression. Python uses a single equals sign. | In total = total + 5, evaluate the right side using the current total, then assign the result back to total. |
| 20 | Initialisation | Giving a variable its starting value before the part of the algorithm that uses or updates it. | Set count = 0 before counting qualifying entries. Resetting count to zero inside every iteration would lose previous progress. |
A symbol can have different effects depending on the data involved. Before predicting a result, check whether each value is a number, text or a Boolean. Use small examples to explain the difference rather than memorising isolated symbols.
| No. | Term | Meaning | Example and use |
|---|---|---|---|
| 21 | Data type | A category of values that helps determine how they are represented and which operations have meaning for them. | The integer 12 and the string “12” look similar when printed but behave differently when combined with another value. |
| 22 | Integer | A whole-number value, including negative numbers and zero. Python represents integers using the int type. | A count of completed tasks might be 0, 3 or 18. A count of 2.5 completed entries would need reconsideration. |
| 23 | Floating-point number | A numerical representation used for values such as fractions and measurements; some decimal values are stored approximately. | A calculated mean may be 13.5. Do not assume every decimal calculation is represented exactly simply because the display looks familiar. |
| 24 | String | A sequence of text characters. In Python, strings use the str type and can contain letters, digits, spaces or punctuation. | The text “007” preserves its leading zeros. Converting it to the integer 7 changes how the information is represented. |
| 25 | Boolean | A value with one of two truth states. The Python Boolean literals are True and False. | The comparison 9 > 4 produces True. The word “False” inside quotation marks is text, not the Boolean value False. |
| 26 | Type conversion | Changing the representation of a value from one data type to another when a suitable conversion is available. | int(“12”) produces the integer 12. Converting “twelve” that way fails, so a program must deal appropriately with unsuitable input. |
| 27 | Arithmetic operator | A symbol that performs a numerical operation on its operands, such as addition, subtraction or multiplication. | In 4 + 3 * 2, multiplication occurs before addition, giving 10. Parentheses can specify a different grouping. |
| 28 | Floor division | Division whose quotient is rounded down towards negative infinity. Python uses the operator //. | 17 // 5 is 3, whereas -17 // 5 is -4. “Remove the decimal part” is misleading for negative quotients. |
| 29 | Modulo | An operation giving the remainder associated with division. Python uses the percent sign for this numerical operation. | 17 % 5 is 2. With a positive integer, testing number % 2 == 0 checks whether it is even. |
| 30 | Exponentiation | Raising a value to a power. Python writes this operation with two asterisks rather than the caret symbol. | 3 ** 2 gives 9. Read the expression as three squared; it is not the same operation as 3 * 2. |
Selection connects a rule in ordinary language to a decision in code. Translate phrases such as “at least”, “both” and “either” carefully. Testing a boundary value often reveals whether the condition matches the intended rule.
| No. | Term | Meaning | Example and use |
|---|---|---|---|
| 31 | Condition | An expression checked to decide whether a particular action or path should be taken; comparisons commonly produce its truth value. | For the rule “at least ten pages”, pages >= 10 is appropriate. pages > 10 wrongly excludes exactly ten. |
| 32 | Selection | A control structure that chooses which instructions to execute according to one or more conditions. | An if, elif, else chain can choose one feedback message from several categories. The order of the conditions affects the result. |
| 33 | Branch | One possible path through a selection structure, containing the instructions chosen for a particular case. | When the condition is false, execution may follow the else branch. It does not also perform the true branch. |
| 34 | Comparison operator | An operator that compares values, such as less than, greater than or equal to, and produces a truth result. | The Python expression score <= 100 includes 100. Explain the equal-to part when describing why the boundary is accepted. |
| 35 | Equality test | A comparison checking whether two values are equal. Python uses two equals signs for this test. | score == 50 checks a value; score = 50 assigns one. Confusing these operations changes the meaning or makes the code invalid. |
| 36 | Logical AND | Combining Boolean conditions so that the combined condition is true only when both conditions are true. | For integer scores, score >= 0 and score <= 100 requires both limits to be satisfied. Passing only one is insufficient. |
| 37 | Logical OR | Combining Boolean conditions so that the combined condition is true when at least one condition is true, including when both are true. | A reminder may appear when missing_name or missing_class is true. It also appears when both pieces of information are missing. |
| 38 | Logical NOT | Reversing a truth value: a true condition becomes false and a false condition becomes true. | If found is False, not found is True. This can identify the case where a search has not located its target. |
| 39 | Nested selection | A selection structure placed inside another branch, so the inner decision is reached only when that outer path is taken. | First check that a score is valid. Within the valid branch, choose the appropriate feedback category for that score. |
| 40 | Indentation | Leading spacing that marks code structure. In Python, consistent indentation identifies which statements belong to a block. | A total update indented inside an if runs only when its condition succeeds. Moving it outside changes the algorithm’s behaviour. |
Each repeated step must serve the task. Keep track of the current item, what has already been processed, and what will make repetition finish. Naming the loop’s purpose is more useful than guessing from its length.
| No. | Term | Meaning | Example and use |
|---|---|---|---|
| 41 | Iteration | Repeated execution of instructions; one iteration is one pass through the relevant repeated steps. | Processing four list items usually involves four passes through a simple for loop. Record the changes caused by each pass separately. |
| 42 | For loop | A Python loop that takes successive items from an iterable, such as a list, string or range. | for mark in marks examines each supplied mark in order. It does not automatically use mark as a list position. |
| 43 | While loop | A loop that repeats its body while its condition remains true, checking that condition before each pass. | A while loop can keep requesting a valid response. Its body must allow progress towards an eventual stopping condition. |
| 44 | Loop body | The group of instructions executed during each pass through a loop, subject to any decisions inside that group. | If addition belongs inside the loop body, every relevant item can contribute. Placing it afterwards may use only the final item. |
| 45 | Range | In Python, a range represents a sequence of integers determined by a start, an excluded stop and a step. | range(2, 6) supplies 2, 3, 4 and 5 when iterated over. It does not include the stop value 6. |
| 46 | Counter | A variable used to keep track of occurrences or progress, commonly increasing by one for each qualifying event. | Start accepted = 0, then add one when a valid entry is found. Rejected entries should not increase that count. |
| 47 | Accumulator | A variable that combines contributions as processing continues, such as a running total that receives successive amounts. | Start total = 0 and add each selected score. The accumulator stores the sum so far, not simply the number of scores. |
| 48 | Termination condition | The rule or event that causes repetition to finish, such as a while condition becoming false or a sequence being exhausted. | If a while loop continues while attempts < 3, check how attempts changes so the loop can eventually finish. |
| 49 | Infinite loop | A loop that continues without reaching a stopping point under the actual conditions of execution. | If n starts at 1, while n < 5 keeps running when its body never changes n or otherwise exits. |
| 50 | Off-by-one error | A mistake in a limit or count that performs an operation once too many or once too few. | Using range(1, 5) when the task requires the integers one through five omits five. Check both intended endpoints. |
Distinguish an item’s value from its position. For a small list, write positions above the items before tracing. For text, make spaces and punctuation visible when they affect the task, especially in splitting or validation questions.
| No. | Term | Meaning | Example and use |
|---|---|---|---|
| 51 | Character | An individual text item within a string, such as a letter, digit, punctuation mark or space in these examples. | The string “A 7” has three characters, including the space. Ignoring that space would give the wrong length. |
| 52 | Index | A position used to access an item in a sequence. Python’s first non-negative index is zero. | For scores = [12, 9, 15], scores[1] is 9. Index one means the second item, not a score of one. |
| 53 | Slicing | Selecting a portion of a sequence using index boundaries and, optionally, a step. The ordinary stop boundary is excluded. | For word = “Punggol”, word[0:4] is “Pung”. The character at index four is not included in this slice. |
| 54 | Concatenation | Joining sequences end to end to make a combined sequence, without performing numerical addition on their contents. | “12” + “3” produces “123”. If the task requires fifteen, convert suitable text to numbers before adding. |
| 55 | Delimiter | A character or sequence of characters used to mark a boundary between pieces of data. | A comma separates the items in “red,blue,green”. Decide how the algorithm should treat an empty item between two commas. |
| 56 | List | An ordered, changeable collection of items in Python. Items can be accessed using their positions. | A list [8, 12, 15, 5] preserves that order. A program can inspect the items one by one or replace an item. |
| 57 | Element | An individual item belonging to a collection, such as one value in a list. | The list [4, 4, 9] has three elements even though two have the same value. Repetition does not reduce its length. |
| 58 | Length | The number of items in a sequence or collection, obtained using len() for the Python examples here. | len([4, 4, 9]) is 3. The last non-negative index is 2, so length and final index are different. |
| 59 | Membership | Whether a particular value occurs in a collection, or a specified substring occurs within a string. | “cat” in “concatenate” is True in Python. That checks for the substring, not whether cat is a separate word. |
| 60 | Traversal | Visiting the items of a collection in a systematic way so that each relevant item can be examined or processed. | Traverse every score when counting all scores above a threshold. Stopping after the first match cannot establish the complete count. |
A dictionary answers questions through keys, while a function packages a task. Read function definitions and calls together: identify the information supplied, where local names apply, and what result is passed back to the caller.
| No. | Term | Meaning | Example and use |
|---|---|---|---|
| 61 | Dictionary | A Python collection that associates unique keys with values, allowing information to be accessed through a key. | In {“A1”: 12, “B2”: 9}, each code identifies a value. A key is not simply a numbered list position. |
| 62 | Key | The part of a dictionary entry used to identify and retrieve its associated value. Each key occurs only once in that dictionary. | In {“team”: “Blue”}, “team” is the key. Assigning a new value to that key replaces its existing associated value. |
| 63 | Value | The data represented or stored; within a dictionary entry, it is the information associated with a particular key. | Two different keys may both have the value 12. Values need not be unique merely because dictionary keys are unique. |
| 64 | Lookup | Retrieving information by using an identifying key or another specified reference. | If scores contains the key “A1”, scores[“A1”] retrieves its associated value. A missing key needs an appropriate response. |
| 65 | Function | A named, reusable unit of code that performs a task and may receive inputs or return a result. | A function calculating a total can be called with different lists. Its usefulness depends on a clear purpose and well-defined behaviour. |
| 66 | Function call | An instruction or expression that invokes a function, supplying any arguments required for that invocation. | Calling double(6) asks the function named double to run with 6 as its argument. Defining the function alone does not perform this call. |
| 67 | Parameter | A name in a function definition that receives information supplied when the function is called. | In def double(number):, number is a parameter. Inside that call, the function can use number to refer to the supplied value. |
| 68 | Argument | A value or expression supplied in a particular function call, corresponding to a parameter when one is required. | In double(6), 6 is the argument. In double(score), the current value of score supplies the information for that call. |
| 69 | Return value | A result passed from a function back to the code that called it, allowing that code to use the result. | return number * 2 supplies a result to the caller. Printing the number on screen does not by itself return that number. |
| 70 | Scope | The region of a program in which a name can be accessed according to the language’s name-resolution rules. | A local variable created inside a function normally belongs to that function’s execution. Do not assume another function can use that local name. |
These patterns help students solve new tasks with familiar reasoning. First work through a tiny example by hand. Then identify the starting state, the repeated operation and the information that must be preserved between steps.
| No. | Term | Meaning | Example and use |
|---|---|---|---|
| 71 | Linear search | A search that checks items sequentially until the task’s stopping requirement is met. | To find all occurrences of 7 in [7, 2, 7], inspect the entire list and record positions zero and two. |
| 72 | Search target | The particular item or value that a search is trying to locate. | When looking for the code “B2”, compare each relevant code with “B2”. Do not confuse the target with its eventual position. |
| 73 | Flag | A variable, often Boolean, used to record whether a condition or event has occurred. | Set found = False before searching, then set it to True after a match. Later code can use this recorded outcome. |
| 74 | Sentinel | A specially chosen value that signals a control action, such as stopping input, instead of representing ordinary data. | If -1 ends entry of non-negative reading times, do not include -1 in the total. The task must define that special meaning. |
| 75 | Running minimum | The smallest value found among the items processed so far, updated when a smaller item appears. | For a non-empty numerical list, initialise the minimum from its first item. Starting at zero can fail when every value is positive. |
| 76 | Running maximum | The greatest value found among the items processed so far, updated when a greater item appears. | For [-8, -3, -11], the maximum is -3. Starting the running maximum at zero would invent a value absent from the list. |
| 77 | Filtering | Selecting items that satisfy a stated condition while excluding those that do not satisfy it. | From [8, 12, 15, 5], filtering for values at least ten keeps 12 and 15. State the condition precisely. |
| 78 | Arithmetic mean | The sum of a set of numerical values divided by the number of those values. | If only 12 and 15 qualify, their mean is 27 divided by 2, giving 13.5. Do not divide by the original list length. |
| 79 | Modularisation | Organising a solution into parts with clear responsibilities, often implemented as separate functions. | One function may check an entry and another calculate a result. Each part needs a clear agreement about inputs and outputs. |
| 80 | Incremental development | Building a solution in manageable stages, checking the work as each useful part is added. | First total a small list correctly, then add filtering, then handle an empty result. This makes new mistakes easier to locate. |
Validation asks whether input satisfies rules for acceptance. Testing asks whether the program behaves as required. Neither is improved by choosing only easy examples: include values that challenge the exact conditions and limits in the specification.
| No. | Term | Meaning | Example and use |
|---|---|---|---|
| 81 | Validation | Checking input against stated acceptance rules before relying on it for processing. | A score of 70 may pass a zero-to-one-hundred range check. That does not prove it is the score the student actually earned. |
| 82 | Presence check | Checking that required data has been supplied rather than left missing. | A required name must not be empty. Decide whether a response containing only spaces should also count as missing. |
| 83 | Range check | Checking whether a value lies within specified numerical or ordered limits, with the endpoints included or excluded as required. | For scores from zero to one hundred inclusive, zero and one hundred are valid. Minus one and one hundred and one are invalid. |
| 84 | Length check | Checking the number of characters or items against a specified exact length or permitted limits. | A code required to contain six characters fails this check when it contains five. Correct length alone does not establish correct format. |
| 85 | Format check | Checking whether data follows a required pattern or arrangement of characters. | A fictional code might require two uppercase letters followed by three digits. Matching that pattern does not prove the code exists in the records. |
| 86 | Existence check | Checking whether supplied data is already present in the relevant stored collection or system. | A correctly formatted club code can still be rejected if no such code appears in the authorised list used by the task. |
| 87 | Check digit | An extra digit calculated from other digits by a specified method, used to help detect certain data-entry errors. | Recalculate the digit using the supplied rule and compare it with the entered digit. Passing the check cannot guarantee that every detail is correct. |
| 88 | Test case | A planned input or situation together with its expected behaviour, used to assess whether a program meets a requirement. | Record the input, expected acceptance or rejection, and expected message before running the program. This makes the outcome meaningful. |
| 89 | Normal test data | Typical valid data chosen to show that ordinary use is handled correctly. | For an integer score between zero and one hundred, 54 is a normal valid example. It does not test either endpoint. |
| 90 | Boundary test data | Data at or immediately around a limit, chosen to reveal mistakes in the way that limit is implemented. | Test -1, 0 and 1 near the lower limit of an inclusive score range. Label which should be accepted and which rejected. |
A useful error report says what should have happened, what actually happened and where the first difference arose. The aim is to understand the cause, correct it and check that the correction still meets the original task.
| No. | Term | Meaning | Example and use |
|---|---|---|---|
| 91 | Invalid test data | Input that breaks at least one acceptance rule and should trigger the specified rejection or other appropriate handling. | For an integer-only score field, “blue” is invalid. The program should respond as required rather than silently treating it as zero. |
| 92 | Syntax error | An error caused by code that breaks the language’s grammatical rules, preventing that code from being parsed correctly. | Writing if score > 50 without the required colon causes a Python syntax error. Correcting it does not prove the condition itself is appropriate. |
| 93 | Run-time error | An error that arises while validly written code is executing, because a particular operation cannot be completed. | Dividing by zero or accessing a list position beyond its bounds can raise an error during execution. Suitable inputs and checks matter. |
| 94 | Logic error | A flaw in the reasoning or instructions that makes a program behave incorrectly even when it can execute. | A total may be wrong because one item is added twice. An absence of error messages does not prove the algorithm is correct. |
| 95 | Dry run | Following a program or algorithm manually, applying each instruction to chosen data without relying on execution to supply the answer. | Use paper to update total after every selected score. Follow what the code actually says, including any mistake it contains. |
| 96 | Trace table | An organised record of relevant variable values and outputs at specified points during a dry run or execution. | If each row represents the end of an iteration, keep that convention throughout. Mixing before-step and after-step values makes the trace ambiguous. |
| 97 | Debugging | Finding the cause of incorrect behaviour and changing the program to address that cause. | Compare expected and actual totals, locate the first incorrect update, explain why it happened, then correct and retest the relevant instruction. |
| 98 | Expected output | The result that a correct solution should produce for a specified test, established from the requirements. | For the inputs 12 and 15, an addition task should produce 27. Calculate that independently rather than copying whatever the program displays. |
| 99 | Actual output | The result produced by the program when the chosen test is executed. | If the program displays 1215 when 27 is expected, investigate text concatenation or missing conversion instead of changing the expected answer. |
| 100 | Refinement | Improving a solution after evaluation, such as correcting behaviour, clarifying structure or handling a required case more appropriately. | After fixing a boundary condition, retest ordinary cases too. A change is useful when the whole required behaviour remains correct. |
Suppose a practice task asks for the mean of the numbers that are at least ten. The data below are invented for learning; they are not results from a school or student. The list contains valid numbers already, so this example concentrates on the algorithm rather than input conversion.
values = [8, 12, 15, 5]
total = 0
count = 0
for value in values:
if value >= 10:
total = total + value
count = count + 1
if count > 0:
print(total / count)
else:
print("No qualifying values")
Before tracing, identify three jobs. The condition selects qualifying values. The accumulator adds those values. The counter records how many values contributed. The denominator must be that count, because the requested mean concerns the selected values rather than the entire original list.
| Point in trace | Condition result | total | count |
|---|---|---|---|
| Before the loop | Not yet checked | 0 | 0 |
| After processing 8 | False | 0 | 0 |
| After processing 12 | True | 12 | 1 |
| After processing 15 | True | 27 | 2 |
| After processing 5 | False | 27 | 2 |
The output is 13.5. The first and last items do not qualify, so they change neither total nor count. A convincing explanation names the relevant state: after processing fifteen, the selected values are twelve and fifteen, their sum is twenty-seven, and their count is two. “It adds the numbers” leaves out the selection rule.
Now change the input to [8, 5]. Both entries fail the condition. The final count is zero, so the program displays the message instead of dividing by zero. If the input is [10], the output is 10.0: ten qualifies because the condition includes equality. These two tests investigate different risks, an empty selected group and an inclusive boundary.
A common mistake is placing count = count + 1 outside the indented if block. That counts every original item and gives the wrong denominator. Another is placing total = 0 inside the loop, which repeatedly discards earlier contributions. Explain the effect of the misplaced instruction before moving it; that explanation shows whether the repair is understood.
Finding the greatest item looks easy until the data challenge an assumption. If every score in a task happens to be positive, a mistaken initial value of zero can go unnoticed. An algorithm should follow the specification, including permitted negative values and any possibility of an empty list.
values = [-8, -3, -11]
if len(values) == 0:
print("No maximum: empty list")
else:
greatest = values[0]
for value in values[1:]:
if value > greatest:
greatest = value
print(greatest)
The program first checks whether there is an item from which to initialise greatest. With the given data, greatest starts at minus eight. Comparing minus three with minus eight replaces it with minus three. Comparing minus eleven with minus three leaves it unchanged. The final output is -3. Zero never appears in the data and has no justification as the answer.
The slice values[1:] visits the remaining items after the first. A one-item list such as [-8] makes this slice empty, but the first item still supplies the correct maximum. An empty original list has no maximum in this task, so it receives a message. A different specification might require a different response; decide that behaviour before writing the algorithm.
The K349 algorithm-design requirements include constructing some solutions without the corresponding shortcuts, including maximum and minimum, totals, searches and splitting. Follow the instruction given in a task: a convenient built-in operation may hide the steps that the student is being asked to demonstrate.
Search questions also depend on exact wording. For [7, 2, 7], “find the first position of seven” and “find all positions of seven” are different tasks. The first can finish after index zero; the second must continue and record index two as well. If no match exists, the required response should be specified rather than silently invented.
Assignment is an action; equality is a question
In x = x + 1, the right side is evaluated using the old value of x, and the result becomes its new value. This is not an algebraic equation claiming that a number equals itself plus one. By contrast, x == 5 asks whether the current value equals five. Read each line aloud with the correct verb: “assign” or “compare”.
Position, value and length answer different questions
For [12, 9, 15], the value at index one is nine, the length is three, and the last non-negative index is two. Draw those relationships before tracing an unfamiliar list. With a Python range, the stop value is excluded: range(1, 5) visits four values and their sum is ten. To include five in this example, use range(1, 6). The Python control-flow tutorial explains the excluded stop and iteration behaviour.
Text that resembles a number remains text until converted
The expression “12” + “3” joins text into “123”. The expression int(“12”) + int(“3”) adds integers to produce fifteen. In these examples, input() returns text; conversion is a separate decision. A program also needs a response when text cannot be converted. The Python introduction provides the language reference for the basic text and numerical operations used here.
Returning a result is different from displaying it
def double(number):
return number * 2
answer = double(6)
print(answer + 1)
The parameter is number and the argument is six. The function returns twelve, which becomes answer. The later print displays thirteen. If the function merely printed twelve instead of returning it, the caller would not receive twelve as its return value; a function that reaches its end without an explicit result returns None. Passing that result into this numerical addition would fail.
Names created inside a function are normally local to that call. A name defined at the top level can be global, but students should not assume that assigning to a name inside a function automatically updates an outside variable with the same spelling. Use explicit parameters and returned results when the task calls for them, and trace where each name is defined.
Imagine a fictional form accepting an integer score from zero to one hundred inclusive. The acceptance rule has more than one part: a response must be supplied, it must represent an acceptable integer, and its value must fall within the permitted range. A range comparison alone does not explain how unsuitable text is handled.
Write the expected result for each case before execution. Fifty-four is an ordinary valid value. Zero and one hundred are valid endpoints. Minus one and one hundred and one are invalid neighbours outside the range. Blank input and the word blue challenge different rules. A test table should state which requirement each case investigates, rather than merely listing many similar numbers.
Boundary and invalid are not mutually exclusive descriptions: minus one is both invalid for this range and immediately outside its lower boundary. State the purpose of the test and the expected response clearly. For decimal measurements, choose neighbours appropriate to the specified precision; the next relevant value is not always one whole unit away.
Passing validation establishes that input satisfies the implemented acceptance rules. It cannot establish every real-world fact. A mistyped score of seventy may still pass a range check when the intended score was seventeen. Similarly, a code with a valid check digit may still contain an undetected error. Explain the protection offered by a check and the limit of that protection.
When debugging, preserve the original failing example. After changing the code, run that example again and check a few relevant ordinary and boundary cases. This provides evidence that the change addressed the cause without damaging another required path. Merely obtaining a different output does not show that the new output is correct.
Attempt these without running code first. A parent can ask the student to state the relevant term before giving the result. The explanation matters: a correct guess does not reveal whether the student can handle a changed example.
1. Which operation changes the variable?
Question: If count is four, what happens after count = count + 1, and what does count == 5 then produce?
Answer: Assignment changes count to five. The later equality test produces True without changing count. The two equals-sign patterns describe different operations, so reading both as “equals” can hide an important misunderstanding.
2. Which endpoint is included?
Question: What values are visited by range(2, 6), and how many are there?
Answer: Two, three, four and five: four values. The start is included and the stop is excluded. Six is not visited. A student who answers five values should check whether they have counted both endpoints.
3. What is the actual selected mean?
Question: Using the worked filtering rule, what should [10, 4, 20] produce?
Answer: Ten and twenty qualify, giving a total of thirty and a count of two. The mean is fifteen. Dividing by three uses the original list length and answers a different question.
4. Is a boundary value valid?
Question: A score must lie from zero to one hundred inclusive. Classify zero and minus one, and explain why both are useful tests.
Answer: Zero is a valid boundary value. Minus one is invalid and immediately outside the lower boundary. Together they help expose a condition that wrongly rejects zero or wrongly accepts values below zero.
5. Where should a maximum start?
Question: Why is greatest = 0 unsuitable before searching [-4, -9, -2] for its maximum?
Answer: No value exceeds zero, so the algorithm could leave greatest at zero even though zero is absent. Initialise from the first item after handling the possibility of an empty list. The correct maximum is minus two.
6. Does a successful run prove correctness?
Question: A program adds the first item twice but completes without an error message. Which error category fits?
Answer: This is a logic error. The instructions can execute while still contradicting the required algorithm. Compare a dry run with an independently calculated expected result, then find the first incorrect addition.
7. What does the key identify?
Question: In records = {“A1”: 12, “B2”: 12}, which part is a key, and do the repeated values create a problem?
Answer: “A1” and “B2” are distinct keys; both associated values are twelve. Repeated values are allowed. Looking up records[“B2”] retrieves twelve using the key, rather than the entry’s numerical position.
8. Which name is a parameter?
Question: For def double(number): followed by return number * 2, identify the parameter, argument and returned result when double(9) is called.
Answer: number is the parameter, nine is the argument, and eighteen is returned. The definition provides the reusable rule; the call supplies the particular input. In a script, returning a result does not itself print it.
Use this as an adjustable routine around the school’s current lessons. Short, careful practice is more useful than rushing through all one hundred entries in a single sitting. Keep a small error record containing the mistaken idea, a corrected explanation and one example that tests the correction.
Week one: specify and explain
Start with problem language, variables and types. For a tiny task, write its inputs, required output and acceptance rules. Choose five unfamiliar terms and explain each in a complete sentence. Use numbers and text that look similar to check whether the learner notices their different types.
Week two: choose and repeat
Practise conditions and loops using lists of three or four values. Predict the result, create a trace table, then execute and compare. Change one boundary or indentation choice and explain the consequences. Keep the examples small enough that every step can be justified.
Week three: organise and test
When functions and dictionaries have been taught, use them in a small extension of a familiar task. Identify each parameter and argument. Plan normal, boundary and invalid cases before running the code. A student should explain the expected response rather than treating a completed run as proof.
Week four: transfer and review
Change the setting while preserving the reasoning: a total of reading minutes might become a total of selected scores. Ask which parts of the algorithm stay useful and which requirements change. Revisit errors from earlier weeks, then use the diagnostic questions to choose the next focused practice.
Ask the learner to talk through a short program while pointing to the changing values. A useful explanation might be: “The counter increases only inside the selected branch because it counts qualifying items.” That gives clearer evidence of understanding than confidence with typing or familiarity with many programming terms.
Locate the difficulty before adding more work. If the task has been misunderstood, practise specifications and examples. If the steps are sensible but the code fails to parse, focus on syntax and structure. If outputs are wrong despite successful execution, practise dry runs and testing. If the learner can copy a solution but cannot adapt it, change one requirement and discuss the consequences.
For any proposed class or learning resource, ask whether its examples match the child’s actual subject level, examination year and current school unit. Request a sample of how a teacher explains a mistaken trace or a failed boundary test. Clear feedback should identify the cause and offer a manageable next exercise; memorising a longer vocabulary list alone may not address the problem.
A hypothetical small-group session could ask learners to predict a result individually, compare their trace tables, explain a disagreement, and test a revised program. The useful feature is the opportunity for each learner to justify a step and respond to feedback. Group size by itself does not establish the quality of that learning process.
Keep the goal concrete: the student should increasingly be able to understand the task, choose suitable steps, explain the code and test the result independently. Return to the relevant ten-word group whenever a missing term obstructs that work. Vocabulary earns its place when it makes the student’s reasoning clearer and more accurate.
Sources and further reading
Official reference links checked on 16 November 2026. Match the syllabus year to the student’s examination year. The vocabulary choices, explanations, exercises and study routines on this page are eduKate teaching material.

