Python Variable, Constant Worksheet
Python Variable, Constant Worksheet
Teacher’s Notes
Lesson Plan
Length 60 mins Specification Link 2.1.7/jk
5 Use the following discussion to explain what variables, E.g. First name, surname, school
constants and identifiers are. admission number, school year, tutor
• Ask the students how their teachers keep track of group, universal student number. (could
them and know who they are dealing with when have a list of these to show to the
checking homework, marking tests and exams, particular class)
writing reports, etc.
• These are their characteristics or properties, e.g.
First_Name = Fred
Surname = Smith
Age = 15
Year = 10
Tutor_Group = 10WA
• Fred, Smith, 15, 10, 10WA are values associated
with them and help to describe them.
• But without knowing that ‘15’ is their age or ‘10’ is
their year group they would be meaningless –
someone could incorrectly assume they were aged
10 and in year 15.
• So each of these values needs an identifier to say
what it is about.
• Ask the students which values will stay the same or first name, universal student number,
constant throughout their school career (surname could be iffy).
• Ask which will change or be variable throughout age, year group, tutor group.
their school career.
Explain to students that, when programming we often
need to keep track of the value of something, so we
create a variable to hold that value.
5 Watch the video, pausing to discuss the content.
®
Time (min) Activity Further Notes
®
WORKSHEET 1 ANSWERS
®
WORKSHEET 2 ANSWERS
Constant: Pi
Constants are defined ONCE and never change, variables can hold different
values
throughout the execution of the program.
(b) The data type of WheelSize is integer and the data type of Circumference is real
number. Explain the difference between an integer and a real number. [2]
Integers are whole numbers, positive or negative (e.g. 7, –5, 0, 2345) whilst real (or
‘floating point’) numbers can have both an integer part and an optional decimal part
(e.g. –27.84, 0, 14.0, 1673.90, 0.413).