Computing KS3 Y7Y8 Convention

Python Programming: Fundamentals

12 lessons

Subject
Computing
Key Stage
KS3
Year group
Y7, Y8
Statutory reference
use 2 or more programming languages, at least one of which is textual, to solve a variety of computational problems
Source document
Computing (KS3/KS4) - National Curriculum Programme of Study
Estimated duration
12 lessons
Status
Convention
Coverage: 7/11 expected capabilities surfaced
Curriculum anchorConcept modelDifferentiation dataThinking lensLesson structurePrior knowledge linksLearner scaffolding
Cross-curricular linksVocabulary definitionsSuccess criteriaAccess and inclusion

Concepts

This study delivers 1 primary concept and 1 secondary concept.

Primary concept: Data Structures and Modular Programming (CO-KS34-C003)

Type: Skill | Teaching weight: 3/6

Data structures are ways of organising and storing data in a program so that it can be accessed and modified efficiently. Common data structures include arrays (indexed collections of items of the same type), lists (dynamic ordered collections), stacks (last-in, first-out collections), queues (first-in, first-out collections), and dictionaries/hash maps (key-value pair collections). Modular programming organises code into self-contained procedures or functions, each responsible for a specific task. This improves readability, enables reuse and simplifies debugging. At KS3, pupils learn to choose appropriate data structures and to design modular programs using procedures and functions.

Teaching guidance: Introduce data structures through problems they naturally solve: arrays for storing a list of scores, a stack for undo operations, a queue for a print job buffer. Teach pupils to choose data structures based on the operations required. Model modular program design: identify distinct tasks, write a function for each, test functions independently. Practice refactoring flat programs into modular ones. Connect data structures to real applications: how does a social media platform store users' friend lists? Develop understanding of the difference between accessing an element by index and searching through a list. Key vocabulary: data structure, array, list, stack, queue, dictionary, record, index, procedure, function, parameter, return, modular, reuse, encapsulate Common misconceptions: Pupils may not see the need for data structures beyond simple variables, especially in small programs. Showing how programs that use appropriate data structures scale to larger problems motivates their use. The difference between passing data to a function by value and by reference is a subtle but important concept that affects program behaviour. Functions that return values are often confused with procedures that only produce side effects; consistent terminology and practice develops clarity.

Differentiation

LevelWhat success looks likeExample taskCommon errors

EmergingCan write simple programs using variables, sequence and basic selection (if/else), but does not use data structures beyond single variables or organise code into procedures or functions.Write a program that asks the user for their age and tells them whether they are old enough to vote (18 or over).Forgetting to convert the input to an integer, causing a comparison error with a string; Using a single equals sign (=) for comparison instead of double equals (==) or >=
DevelopingUses arrays/lists to store collections of data, writes programs with loops that process data structures, and begins to organise code into procedures or functions for clarity.Write a program that stores 5 test scores in a list, calculates the average, and prints which scores are above the average.Calculating the average by dividing by a hardcoded number (5) instead of using len(scores); Using a single loop to both calculate the total and compare to the average (the average is not yet known during the first loop)
SecureChooses appropriate data structures for different problems, writes modular programs using functions with parameters and return values, and debugs programs systematically.Write a function called 'find_max' that takes a list of numbers as a parameter and returns the largest number, without using the built-in max() function.Initialising 'largest' to 0 instead of the first element, which fails for lists of negative numbers; Not handling edge cases such as an empty list or a list with one element
MasteryDesigns programs using appropriate data structures (stacks, queues, dictionaries), writes well-structured modular code with clear documentation, and analyses the efficiency and robustness of their solutions.Design a program for a library book-borrowing system. It should track which books are available, allow borrowing and returning, and use appropriate data structures. Justify your data structure choices.Using a list instead of a dictionary, requiring linear search to find a specific book; Not including input validation (what if the ISBN does not exist? what if the book is already borrowed?)

Model response (Emerging): age = int(input('Enter your age: '))

if age >= 18:

print('You are old enough to vote.')

else:

print('You are not old enough to vote yet.')

Model response (Developing): scores = [72, 85, 63, 91, 78]

total = 0

for score in scores:

total = total + score

average = total / len(scores)

print('Average:', average)

for score in scores:

if score > average:

print(score, 'is above average')

Model response (Secure): def find_max(numbers):

if len(numbers) == 0:

return None

largest = numbers[0]

for number in numbers[1:]:

if number > largest:

largest = number

return largest

# Test

print(find_max([3, 7, 2, 9, 5])) # Should print 9

print(find_max([-5, -1, -8])) # Should print -1

print(find_max([42])) # Should print 42

print(find_max([])) # Should print None

Model response (Mastery): I would use a dictionary where each key is the book's ISBN and the value is another dictionary containing title, author and status (available/borrowed/borrower_name).

library = {}

def add_book(isbn, title, author):

library[isbn] = {'title': title, 'author': author, 'status': 'available', 'borrower': None}

def borrow_book(isbn, borrower):

if isbn not in library:

return 'Book not found'

if library[isbn]['status'] == 'borrowed':

return f'Already borrowed by {library[isbn]["borrower"]}'

library[isbn]['status'] = 'borrowed'

library[isbn]['borrower'] = borrower

return f'{library[isbn]["title"]} borrowed by {borrower}'

def return_book(isbn):

if isbn not in library or library[isbn]['status'] == 'available':

return 'Error: book not currently borrowed'

library[isbn]['status'] = 'available'

library[isbn]['borrower'] = None

return f'{library[isbn]["title"]} returned'

Justification: A dictionary provides O(1) average lookup by ISBN — essential for a system that may contain thousands of books. Using a list would require O(n) linear search. The nested dictionary for each book groups related data logically. Functions are modular: each handles one operation with input validation and clear return messages.

Secondary concept: Algorithms: Sorting, Searching and Complexity (CO-KS34-C001)

Type: Knowledge | Teaching weight: 3/6

Classic algorithms for sorting (bubble sort, merge sort, quick sort) and searching (linear search, binary search) represent fundamental computational problems with well-understood solutions of different efficiencies. Algorithm complexity - how the time or space required by an algorithm grows as the input size grows - is expressed using Big O notation (O(n), O(n log n), O(n^2)). Understanding that different algorithms solving the same problem have different performance characteristics, and that the choice of algorithm matters at scale, is a key insight of computer science. At KS3, pupils study these algorithms, understand how they work and begin to compare their relative efficiency.

Differentiation

LevelWhat success looks likeCommon errors

EmergingUnderstands that algorithms are step-by-step instructions for solving a problem, and can trace through a simple algorithm with small inputs, but cannot compare algorithms or explain efficiency.Not comparing adjacent pairs systematically, skipping some comparisons; Stopping after one pass and declaring the list sorted when it is not
DevelopingCan explain how several sorting and searching algorithms work, and recognises that different algorithms solve the same problem with different efficiency, though cannot yet quantify this using Big O notation.Forgetting to mention that binary search requires a sorted list as a precondition; Saying binary search 'splits the list in two' without explaining which half is discarded and why
SecureImplements sorting and searching algorithms in code, uses Big O notation to describe algorithmic complexity, and selects appropriate algorithms for given problem constraints.Stating the Big O complexity without explaining what it means in practical terms; Not mentioning the space complexity trade-off (merge sort uses more memory than bubble sort)
MasteryAnalyses algorithmic trade-offs in real-world contexts, understands that no single algorithm is optimal for all situations, and evaluates algorithm choice based on input characteristics, constraints and requirements.Recommending a single algorithm without considering the different types of queries the system needs to support; Not recognising that real-world systems combine multiple algorithms and data structures


Thinking lens: Systems and System Models (primary)

Key question: What are the parts of this system, how do they interact, and what happens when something changes? Why this lens fits: Modular programming requires pupils to decompose a system into functions/procedures with defined inputs and outputs — the program as a whole is a system of interacting modules, and the design task is to model the right modular decomposition. Question stems for KS3:
  • What feedback loops exist in this system?
  • Does this model capture all the important interactions, or does it oversimplify?
  • What emergent property arises from these components interacting?
  • How would removing or adding a component change the system's behaviour?
  • Secondary lens: Patterns — Sorting and searching algorithms are canonical patterns — pupils study merge sort, binary search and others as reusable solutions to classes of problems, developing the pattern-recognition skill of identifying which algorithmic pattern fits a given problem.

    Session structure: Practical Application

    Practical Application

    A hands-on sequence where pupils apply knowledge and skills to solve a practical problem or create a functional outcome. Begins with a real-world context, builds skills through rehearsal, guides design or planning, supports making or problem-solving, and concludes with evaluation against success criteria.

    contextskill_rehearsaldesignmake_or_solveevaluate Assessment: Practical outcome (solution, product, program) evaluated against defined success criteria, with written or verbal explanation of the process and decisions made. Teacher note: Use the PRACTICAL APPLICATION template: present a realistic problem context that requires pupils to select and apply relevant knowledge and skills. Expect pupils to rehearse key techniques, design a solution with justification, and carry out the task with attention to accuracy and quality. Guide evaluation that considers both the outcome and the effectiveness of their approach. KS3 question stems:
  • What knowledge and skills are relevant to this problem, and how do they connect?
  • Why did you choose this approach over alternatives?
  • How effectively does your solution address the original problem?
  • What would you evaluate as the strengths and weaknesses of your approach?

  • Computing focus

    Programming paradigm: Text Based Software/tool: Python Computational concepts: sequence, selection, repetition, variable, function Abstraction level: Symbolic Themes: text-based programming, Python, computational thinking

    Why this study matters

    Python is the standard text-based language for KS3 because its clean syntax (enforced indentation, minimal boilerplate) makes it the most readable language for novice programmers transitioning from block-based environments. This unit covers variables, data types, input/output, selection (if/elif/else), iteration (for and while loops), and string manipulation. Each concept is introduced through a small practical project rather than isolated exercises.


    Pitfalls to avoid

  • Indentation errors causing frustration -- teach that Python uses indentation as syntax, not decoration
  • Students copy-pasting code without understanding -- require line-by-line annotation of every program
  • Moving too fast from block-based thinking -- allow time for the cognitive shift to text-based programming

  • Computational thinking skills (KS3)

    These disciplinary skills should be woven through teaching, not taught in isolation:

  • Algorithm design (KS1) — Create precise, unambiguous sequences of instructions to accomplish a goal; understand that a computer follows instructions exactly as written; design, implement and debug simple programs as algorithms expressed in a programming environment; use logical reasoning to predict what a simple program will do.
  • Pattern recognition (KS2) — Identify patterns and regularities in data sets and program behaviours; use pattern recognition to select appropriate control structures (repetition for repeated actions, selection for conditional branching); generalise from specific examples to produce reusable solutions; recognise when an existing algorithm or program component can be reused to solve a new problem.
  • Pattern recognition (KS3) — Identify and exploit structural patterns in computational problems to select or design efficient algorithms; recognise recurring algorithmic patterns such as searching, sorting and divide-and-conquer; use pattern recognition to understand when different data structures naturally suit a problem's access patterns; analyse trends in data and use them to inform computational solutions.
  • Abstraction (KS1) — Focus on the most important features of a problem or task while ignoring unnecessary detail; represent real-world actions as simple step-by-step instructions that capture the essential logic without irrelevant specifics.
  • Pattern recognition (KS1) — Notice repeated elements in sequences of instructions or in real-world tasks; identify when a set of steps recurs and recognise that repetition can be expressed more efficiently using loops; spot similarities between different problems that suggest the same solution approach can be applied.
  • Data representation (KS3) — Understand how data of various types — integers, text, images, sound — is represented and manipulated in binary form; convert between binary and decimal number representations and perform simple binary arithmetic; understand how data structures (arrays, lists, records) organise data in programs; understand that all digital information is encoded as binary digits regardless of its perceived type.

  • Vocabulary word mat

    TermMeaning

    algorithm
    array
    big o
    binary search
    bubble sort
    comparison
    complexity
    data structure
    dictionary
    efficiency
    encapsulate
    function
    index
    iteration
    linear search
    list
    merge sort
    modular
    parameter
    procedure
    queue
    record
    recursion
    return
    reuse
    search
    sort
    stack
    swap
    trace
    Python
    variable
    data type
    string
    integer
    float
    boolean
    if
    elif
    else
    for loop
    while loop

    Prior knowledge (retrieval plan)

    Pupils should already know the following from earlier units:

    Prior knowledge neededFor conceptDescription

    AlgorithmsAlgorithms: Sorting, Searching and ComplexityAn algorithm is a precise, unambiguous sequence of instructions for solving a problem or accompli...
    Programming: Sequence, Selection and RepetitionData Structures and Modular ProgrammingAll programs are built from three fundamental control structures: sequence (instructions executed...


    Scaffolding and inclusion (Y7)

    GuidelineDetail

    Reading levelSecondary Transition Reader (Lexile 700–950)
    Text-to-speechAvailable
    Max sentence length30 words
    VocabularySecondary curriculum vocabulary including discipline-specific terms. Etymology and morphology appropriate (e.g., prefixes, roots). Formal academic register expected.
    Scaffolding levelLight
    Hint tiers4 tiers
    Session length25–40 minutes
    Worked examplesRequired — Text-based. Reference solutions available after independent attempt.
    Feedback toneAcademic Peer
    Normalize struggleYes
    Example correct feedbackCorrect — and the implication is worth noting: if this is true, then [connected consequence] should also hold. Does it?
    Example error feedbackThat reasoning has a gap: you assumed [X], but the evidence points the other way because [Y]. Revise your argument in light of that.


    Knowledge organiser

    Key terms:
  • Python
  • variable
  • data type
  • string
  • integer
  • float
  • boolean
  • if
  • elif
  • else
  • for loop
  • while loop
  • function
  • parameter
  • return
  • Core facts (expected standard):
  • Data Structures and Modular Programming: Chooses appropriate data structures for different problems, writes modular programs using functions with parameters and return values, and debugs programs systematically.

  • Graph context

    Node type: ComputingTopicSuggestion | Study ID: TS-CO-KS3-001 Concept IDs:
  • CO-KS34-C003: Data Structures and Modular Programming (primary)
  • CO-KS34-C001: Algorithms: Sorting, Searching and Complexity
  • Cypher query:

    ``cypher

    MATCH (ts:ComputingTopicSuggestion {suggestion_id: 'TS-CO-KS3-001'})

    -[:DELIVERS_VIA]->(c:Concept)

    -[:HAS_DIFFICULTY_LEVEL]->(dl)

    RETURN c.name, dl.label, dl.description

    ``


    Generated from the UK Curriculum Knowledge Graph — zero LLM generation.