Lesson 2: String methods, the tools every string carries
14 min read·14 Oct 2026
Module 3 · Lesson 2 · About 40 minutes · Needs: Module 3 Lesson 1 (indexing, slicing, len(), strings cannot change)The situation
Amira hands you a printout of Tom's notebook. "Can you read this? I want each loan split into its date, title and name." You look at line 6:
The line holds four pieces separated by space, hyphen, space: borrow date, title, first name, and back with the return date. The name is in lower case with extra spaces. Slicing by hand would mean counting characters on every line. Python strings come with ready-made tools for this job. This lesson teaches them on line 6, then uses them on lines 4 and 5.