Strings

5 min · 10 quiz questions

Year 9 · Chapter 13 Python: lists, strings, functions · Lesson 2. This lesson goes with level 5 of the Byte Lab Year 9 game. Play the level first, then use this page to revise.

Learning objectives. By the end of this lesson you should be able to get a character from a string with its index; cut out part of a string with a slice; use the methods upper, lower, strip, replace and count; join strings and numbers; and loop through the characters of a string.

In this lesson

  • A string is a row of characters
  • Slices
  • String methods
  • Joining strings
  • Looping through a string
  • A string cannot be changed
  • Shortcuts to know
  • Real mission: your username generator
  • Revision checklist