L2 Lesson plan - Programming - KS4
L2 Lesson plan - Programming - KS4
Lesson 1 - Translators
Lesson 2: Sequence
Introduction
In this lesson, learners will be introduced to a Python IDE of your choice. They
will learn about the function of an IDE and why programmers use these to write
programs. Learners will be given some simple code to predict, run, investigate,
and modify. Whilst they take their first steps in Python programming, they will
also learn about common errors and error types.
Learning objectives
● Describe the tools an IDE provides (editors, error diagnostics, runtime
environment, translators)
● Use subroutines in programs
● Define a sequence as instructions performed in order, with each executed
in turn
● Predict the outcome of a sequence and modify it
● Interpret error messages; define error types and identify them in programs
(logic, syntax)
Key vocabulary
IDE, translator, interpreter, subroutine, sequence, execute, error messages,
syntax error, logic error, syntax
Preparation
Choose your IDE
We recommend that you use Mu as the IDE for Python because it has a friendly
split-screen layout and lots of helpful features for learners. You can download Mu
here: https://codewith.mu/en/download (ncce.io/downloadmu)
Another option is to use Trinket.io, which also offers the split-screen element
where learners can see their code and output in one window.
All programming code will be provided via Trinket and the worksheet.
Subject knowledge:
Optional:
● Vocabulary sheet
● Twinkle, twinkle, Python file (ncce.io/ks4-twinklestart)
● Twinkle complete (ncce.io/ks4-twinklecomplete)
Assessment opportunities
The starter activity allows you to check what learners remembered about
translators from the last lesson. Use this time to recap it with your learners.
The ‘Introducing your IDE’ activity provides an opportunity to see how quickly
learners can debug their programs. It also asks for definitions of syntax and logic
errors, which can be checked against the vocabulary sheet by peers or you.
The ‘Twinkle, twinkle, little sequence’ activity is a PRIMM activity. Model answers
have been provided for this worksheet if you wish to use them for self- or peer-
assessment.
Outline plan
Please note that the slide deck labels the activities in the top right-hand corner
to help you navigate the lesson.
Use live coding to introduce the IDE and some simple code for
learners to try. Whilst demonstrating the IDE, be sure to talk about
the features described in the previous activity and point these out to
learners.
def welcome():
print(“Hello world”)
welcome()
You’ll be using subroutines right from the start with learners, so that
they can become familiar with them. It is not expected that they will
fully understand what they are and how to use them in all scenarios,
as this will be covered later in the unit. The benefit of introducing
subroutines is that learners will be able to separate their code into
units from an early stage, which can help make the finer details of
subroutine creation easier to grasp in the future.
When writing the code, demonstrate a syntax error and a logic error,
defining the terms as you do so.
A syntax error: Where the code written doesn’t match the syntax
of the language being used. For example, missing out a closing
bracket or a colon.
A logic error: Can be quite tricky to spot because they are often
not picked up by the IDE. The program will run, but it won’t behave
in the way that you expect it to.
You can cause a logic error by not calling the subroutine and
demonstrating that nothing happens when the code is run, but no
error messages appear.
You can cause a syntax error by going in and deleting a speech mark
or a bracket and showing learners what happens.
After live coding with the learners, give them some time to practise
typing in the code used in the demonstration. The ‘Your first Python
code’ worksheet has been prepared for your learners. It reveals
common errors that occur when programming and helps to support
learners through the debugging process. The worksheet also asks
learners to provide definitions for a syntax and logic error before
providing some additional explorer tasks.
There might not be enough time for learners to complete the make
step, so this has been set as an optional homework for this lesson.
Model answers have been provided for the worksheet to be used for
peer- or self-assessment if needed.
Note: The slides are animated, they will reveal the answer and then
the reason for the correct answer.
Homewor Complete the make step from the Twinkle, twinkle, little sequence’
k activity.
Resources are updated regularly — the latest version is available at: ncce.io/tcc.
Attribution statement
This resource was created by Raspberry Pi Foundation and updated by STEM Learning for the
National Centre for Computing Education.
The contents of this resource are available for use under the Open Government License (OGL v3)
meaning you can copy, adapt, distribute and publish the information. You must acknowledge the
source of the Information in your product or application, by attributing Raspberry Pi Foundation and
STEM Learning as stated here and are asked to provide a link to the OGL v3.
Page 5 Last updated: 10-05-24
KS4 - Programming Lesson plan
Lesson 1 - Translators