# Strings > Ninth graders work with strings — text data. They join strings with +, measure them with len(), read characters by index (starting at 0), transform them with… **Computer Science** | **Grade 9** *A free lesson plan from K12 Academics. Source page: https://lessonplans.k12academics.com/k12-lesson-g9-cs-strings.html* Ninth graders work with strings — text data. They join strings with +, measure them with len(), read characters by index (starting at 0), transform them with methods like .upper(), and take slices. They explore each, then process text in code. **Copy link** works with Canvas, Schoology, Moodle and any other LMS — paste it in as a resource or assignment. ## Everything you need before the bell rings ### Learning Objectives Students will be able to… - Join strings with **+**. - Use **len()** and **indexing**. - Transform with **methods**. - Slice a string. How do programs store and manipulate text? ## The String Explorer Project this and tap each. Have students explore how Python handles strings. ## 55 minutes, five moves Tap any phase to open the teacher moves and student actions. ### Hook — Text Is Data How could a program greet someone by name? #### 👩‍🏫 Teacher Moves - Show two pieces of text being joined. - Ask how to combine text. - Set the goal. #### 🎒 Student Actions - Look. - Guess. - Get ready. ### Use — Strings Students use strings. #### 👩‍🏫 Teacher Moves - Send students to the String Explorer. - Tap each operation. - Note indexing starts at 0. #### 🎒 Student Actions - Tap each. - Say. - Note it. ### Modify — Transform It Students modify. #### 👩‍🏫 Teacher Moves - Uppercase a string. - Slice out a piece. - Join two strings. #### 🎒 Student Actions - Upper. - Slice. - Join. ### Create — Build Students create. #### 👩‍🏫 Teacher Moves - Make a greeting from inputs. - Count the characters. - Slice part of it. #### 🎒 Student Actions - Build. - Count. - Slice. ### Reflect — Reflect Students close. #### 👩‍🏫 Teacher Moves - Say what len() returns. - Say the first index number. - Complete the exit ticket. #### 🎒 Student Actions - Say it. - Say. - Complete the exit ticket. ## Built to the standards you report on Aligned to the CSTA K-12 Computer Science Standards and the ISTE Standards for Students. Use data and procedures to manage complexity. Iteratively develop programs using control structures. Evaluate and refine computational artifacts. Transform data to solve problems. ## One lesson, every learner ### Multilingual Learners - Count characters on fingers. - Label index positions. - Say operations aloud. ### Support & Access - Start with + joining. - Index the first letter only. - Use short words. ### Stretch & Extend - Use .replace() and .find(). - Format a string with f-strings. - Loop over characters. ### What to gather - 📽️Screen / board - 🔤Index strips - 💻The String Explorer - 🐍Python / editor - 📓Notebooks - 🎫Exit-ticket slips ### Key terms - **string**: text data, in quotes - **concatenate**: to join strings with + - **len()**: returns the number of characters - **index**: a character position (starting at 0) - **method**: a built-in action like .upper() - **slice**: a piece of a string by index range - **character**: one letter, digit, or symbol - **immutable**: a string cannot be changed in place ## Exit Ticket Preview the three formative checks. Tap “Sample answer” to see what mastery looks like — hide them before you print for students. ### Reflect: strings. Have students join two strings and print their total length. A printable strings worksheet is in the Computer Science library. ## Check your understanding **1. What does “string” mean?** - text data, in quotes *(correct)* - a built-in action like .upper() - one letter, digit, or symbol - returns the number of characters “string” means: text data, in quotes **2. Which word means: “to join strings with +”?** - concatenate *(correct)* - method - immutable - character “concatenate” means: to join strings with + **3. What does “len()” mean?** - returns the number of characters *(correct)* - a string cannot be changed in place - one letter, digit, or symbol - a character position (starting at 0) “len()” means: returns the number of characters **4. Which word means: “a character position (starting at 0)”?** - index *(correct)* - slice - method - concatenate “index” means: a character position (starting at 0) **5. What does “method” mean?** - a built-in action like .upper() *(correct)* - to join strings with + - returns the number of characters - a piece of a string by index range “method” means: a built-in action like .upper() **6. Which word means: “a piece of a string by index range”?** - len() - slice *(correct)* - character - method “slice” means: a piece of a string by index range ## Printable worksheet --- Full lesson page: https://lessonplans.k12academics.com/k12-lesson-g9-cs-strings.html All lessons: https://lessonplans.k12academics.com/