Python
Python
Lesson Objectives
Lesson Objectives
• Understand which data type a variable is.
• Understand why a computer needs to know what the data type
is for a given input/variable.
• Learn how to change the data type of a variable.
Lesson Outcomes
• Carry out a number of programming tasks to practice
programming simple arithmetic.
Strinsgany
an
This me keyboard Real
b i na ti on of m e a n s a n y decimal
com
te r s ( letters, Integer This
umber
chara c
s y m bols) (fractional) n
r s This means
numbe any whole
number. If
the comput
knows the d er
ata is an
integer it ca
n do maths
with the da
ta
The need to tell the computer what data type
the variable will store
• Computers store values in variables
Above you can see that two numbers have been entered and stored
in variables num1 and num2.
Twent
Num1
y Nine
Mr Int.
Once they have been converted we’re
ready to do maths!
Fiv Nin
e e
Num Num
1 2
5 9
Fiv Nin
e e
Num Num
1 2
14
Answer 5 + 9
14
Answer
14
Tasks
• Work your way through the worksheet sheet.