0% found this document useful (0 votes)
6 views3 pages

L8c L2 Arithmatic&Date Types

The document outlines a lesson plan focused on working with arithmetic and data types in Python. It explains the importance of setting data types correctly, provides examples of challenges for students to complete, and includes instructions for programming various calculations. Additionally, it offers extension tasks for more advanced programming exercises involving multiple numbers and mixed operations.

Uploaded by

23joppong
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views3 pages

L8c L2 Arithmatic&Date Types

The document outlines a lesson plan focused on working with arithmetic and data types in Python. It explains the importance of setting data types correctly, provides examples of challenges for students to complete, and includes instructions for programming various calculations. Additionally, it offers extension tasks for more advanced programming exercises involving multiple numbers and mixed operations.

Uploaded by

23joppong
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

Student Name:

Date:

L.O: To work with arithmetic and data types in python.

Data Types

We should remember from Year 7 work that when we use inputs we might have to set
different Data Types. When it comes to Data Types Python will automatically assumes the
data we input is a ‘string’ (a collection of keyboard characters) unless we instruct it
otherwise. But this may cause issues:

See below we have entered two decimal numbers, but python has just displayed them one
after the other. This is because of the default string setting.

Now if we set the data type to a decimal number (float) in our code and we get the result
we would expect, python has added up our two inputs.

Setting up data types

It’s fairly simple to set up a data type. There are two main ways:

L8c_L2_Arithmatic&Data_Types
Student Name:
Date:

Today we are going to do some work with different data types by programming a range of
data calculations.

Note: A computer uses the following symbols to perform calculations, you will need these to
program python:

+ Addition - Subtraction / Division * Multiplication

1. Using the codes above complete the challenges below. You need to look carefully at
the challenge as it will say which data type you need to include. Take a screenshot of
both your code, and the result when you run it:

Challenge 1:
Can you write a python program write a program that will allow the user to enter their
firstname then their surname as a string; then add them together to display them on one
line as an output?

Challenge 2:
Can you write a python program write a program that will store two whole number inputs
from the user and subtract one from the other, then display the result.

number1=int(input("pease enter the


number you like to subrtract:"))
number2=int(input("pease enter the
second number you like to subrtract:"))
print (number1 - number2)

Challenge 3:
Can you write a python program write a program that will store two Decimal Number inputs
from the user and perform a multiplication, then display the result.

L8c_L2_Arithmatic&Data_Types
Student Name:
Date:

Extension’s:
Can you write a program that performs a calculation on 3 or more numbers? You can choose
if it is an integer or a decimal.

Can you write a program that performs a mixed calculation (addition, and subtraction; or
multiply and addition) on 3 or more numbers? Again you can choose if it is an integer or a
decimal.

L8c_L2_Arithmatic&Data_Types

You might also like