0% found this document useful (0 votes)
43 views2 pages

Y10 05 CT27 Lesson Plan

lesson plan

Uploaded by

molaposk10
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)
43 views2 pages

Y10 05 CT27 Lesson Plan

lesson plan

Uploaded by

molaposk10
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/ 2

TOPIC 1: COMPUTATIONAL THINKING

String processing

LESSON PLAN FOR Y10-05-CT27

Lesson Specification Details Resources


content
CT27 1.2.2 Learning outcomes Lesson slides
6.3.1  Split lines on commas
6.3.3 Python IDE
 Store items in lines as records in a 2D (e.g. PyCharm,
6.4.2 structure. Thonny, IDLE,
etc.)
Lesson plan
 Remind students of what they learned in Lesson
the previous lesson about working with activities
text files. Recap opening a file, reading
the lines in, and stripping the ‘new line’
character.
 Show the screenshot of the variable
inspection window (consider using the
debugger and a breakpoint to show how
the user’s Table looks in memory.)
Explain that the arrays that students have
previously created contain a set of strings
with each string being a complete line
from the text file. Explain that the next
stage is to split each single string into its
different parts to make a record. NB:
Fields are sometimes referred to as
columns or attributes.

 Explain to the students that they will be


using a string function called
<string>.split(), which returns a list. Show
the example and explain the three parts
of the statement – a new variable to store
the returned list, the original item from
the list of lines, and the character that the
string will be split on.
 Discuss the example provided. Ask
students to identify how the line read
changes from a single string to a list of
strings. Emphasise that after the split, all
items are still strings and that to use
them as integers, they need to be
converted using the int() function. Ask
students to complete Activity 1 to practise
using <string>.split().

 Explain that the next stage is to bring


© Pearson Education Ltd 2020. Copying permitted for purchasing institution only. This material is not copyright free.
1
TOPIC 1: COMPUTATIONAL THINKING

String processing

Lesson Specification Details Resources


content
together everything the students have
learned so far, so that they can create
programs that work with real data. Ask
students to complete Activity 2. NB: This
is a long activity that uses the PRIMM
approach.
 Wrap up.

Homework
 See homework document.

© Pearson Education Ltd 2020. Copying permitted for purchasing institution only. This material is not copyright free.
2

You might also like