Python course · Chapter 8

Working with text

Indexes, slices, len(), string methods, looping through text.

Project: a username maker and a Caesar cipher.

  1. 8.1Letters and indexesEvery character in a piece of text has a numbered position, starting from 0.6 steps · about 20 minutes · 0 of 3 challenges passedStart →
  2. 8.2SlicesCut a piece out of a string with [start:stop]: the start, up to but not including the stop.6 steps · about 20 minutes · 0 of 3 challenges passedOpen →
  3. 8.3String methodsBuilt-in tools for text: change the case, tidy spaces, search, count and replace.6 steps · about 20 minutes · 0 of 3 challenges passedOpen →
  4. 8.4Looping through textA for loop can visit every character in a string, one at a time, to count or build something new.6 steps · about 20 minutes · 0 of 3 challenges passedOpen →
  5. 8.5Project: username makerUse slices and string methods to make usernames from names and years, and check the input is sensible.5 steps · about 20 minutes · 0 of 3 challenges passedOpen →
  6. 8.6Project: Caesar cipherTurn letters into numbers and back again to write secret messages with one of the oldest codes there is.6 steps · about 20 minutes · 0 of 3 challenges passedOpen →
  7. CheckCheckpointFive mixed questions on working with text, with loops and decisions mixed back in. Pass them all to finish the chapter.1 steps · about 15 minutes · 0 of 5 challenges passedOpen →