Home›Lesson Plans›Computer Science›Programming · Grade 9

String Methods

Ninth graders learn Python string methods — built-in tools like .upper(), .lower(), .split(), and .replace() that transform text, plus len() to count characters. They make text processing fast and easy. They match methods to their jobs, then use them.

Grade 9String Methods55 minutes1 class periodCSTA / ISTEExplicit teaching4 StandardsCSTA
Start the Lesson
Assign or share this lesson

Copy link works with Canvas, Schoology, Moodle and any other LMS — paste it in as a resource or assignment.

Lesson at a Glance

Everything you need before the bell rings

Learning Objectives

Students will be able to…

  • ✓Use string methods.
  • ✓Transform text.
  • ✓Split & replace.
  • ✓Process strings.
Essential Question

What built-in tools does Python give you for working with text?

0
Lesson Phases
0
Vocabulary Terms
0
Standards Aligned
0
Interactive Task
Match It · Interactive

Match the String Method

Project this and match each method to what it does — tap the method, then tap its job.

🔤 Match each string method to what it doesTry it
Method
What it does
Now tap the job!
The Lesson · Explicit teaching

55 minutes, five moves

Tap any phase to open the teacher moves and student actions.

1

Hook — Text Tools

6 min

Need to lowercase a name or split a sentence — do you code it from scratch?

👩‍🏫 Teacher Moves

  • Pose the question.
  • Share ideas.
  • Set the goal.

🎒 Student Actions

  • Think.
  • Share.
  • Get ready.
2

Use — String Methods

13 min

Students learn.

👩‍🏫 Teacher Moves

  • Send students to Match the String Method.
  • Match each one.
  • Note methods return new strings.

🎒 Student Actions

  • Match.
  • Say.
  • Note it.
3

Modify — Use It

14 min

Students practice.

👩‍🏫 Teacher Moves

  • Uppercase a word.
  • Split a sentence.
  • Replace a word.

🎒 Student Actions

  • Upper.
  • Split.
  • Replace.
4

Create — Create

15 min

Students apply.

👩‍🏫 Teacher Moves

  • Clean up some text.
  • Chain two methods.
  • Count characters.

🎒 Student Actions

  • Clean.
  • Chain.
  • Count.
5

Reflect — Reflect

7 min

Students close.

👩‍🏫 Teacher Moves

  • What does .split() do?
  • What does len() do?
  • Complete the exit ticket.

🎒 Student Actions

  • Say it.
  • Say it.
  • Complete the exit ticket.
Standards Alignment

Built to the standards you report on

Aligned to the CSTA K-12 Computer Science Standards and the ISTE Standards for Students.

CSTA
3A-AP-14

Use built-in methods on strings.

CSTA
3A-AP-16

Develop programs that process text.

CSTA
3A-AP-17

Test string-handling code.

ISTE
5c

Use tools to manipulate data.

Differentiation

One lesson, every learner

Multilingual Learners

ELL / EMERGING READERS
  • Method/job cards.
  • Frame: "upper() makes it ___."
  • Demo each live.

Support & Access

IEP / 504
  • Match upper & lower.
  • Use 3 methods.
  • Use examples.

Stretch & Extend

GIFTED / EARLY FINISHERS
  • Chain several methods.
  • Use .strip() and .find().
  • Build a text cleaner.
Materials

What to gather

  • 🔤Method cards
  • 📽️Screen / board
  • 💻Match the String Method
  • 💻Python
  • 📓Notebooks
  • 🎫Exit-ticket slips
Vocabulary

Key terms — hover for a quick definition

stringtext datamethodan action on a value.upper()make uppercase.lower()make lowercase.split()break into a list.replace()swap textlen()count characterschaincombine methods
Evaluate

Exit Ticket

Preview the three formative checks. Tap “Sample answer” to see what mastery looks like — hide them before you print for students.

QUESTION 1
What does .split() do?
Breaks a string into a list of parts.
QUESTION 2
What does len() do?
Counts the characters in a string.
QUESTION 3
What does .replace(a, b) do?
Swaps one piece of text for another.

Reflect: string methods.

Have students clean up text using string methods. A printable method sheet is in the CS library.

Study · Flashcards

Study the key terms

Tap a card to flip it, then rate whether you knew it. Built from this lesson’s vocabulary.

🃏 String MethodsFlip
Card 1
Term
Tap to flip →
Meaning
0

Nice work!

Practice · Quiz

Check your understanding

A quick self-check with instant feedback, drawn from this lesson’s key terms.

📝 String MethodsQuiz
Score: 0
1 / 6
Question 1
0%

Nice work!

Practice · Worksheet

Printable worksheet

A print-and-go review sheet with a built-in answer key. Tap “Show answer key” to reveal answers, or print the clean version for students.

🖨️ String MethodsPrint
Name: ________________________
Date: ____________

Part A · Write the word that matches each meaning

Word bank: .lower(), .replace(), .split(), .upper(), chain, len(), method, string
  1. swap text
  2. make uppercase
  3. text data
  4. break into a list
  5. make lowercase
  6. an action on a value
  7. combine methods
  8. count characters

Part B · Show what you learned

  1. What does .split() do?
  2. What does len() do?
  3. What does .replace(a, b) do?
Answer key — Part A: 1) .replace() · 2) .upper() · 3) string · 4) .split() · 5) .lower() · 6) method · 7) chain · 8) len()
Part B: 1) Breaks a string into a list of parts. 2) Counts the characters in a string. 3) Swaps one piece of text for another.