Python course · Chapter 8
Working with text
Indexes, slices, len(), string methods, looping through text.
Project: a username maker and a Caesar cipher.
- 8.1Letters and indexesEvery character in a piece of text has a numbered position, starting from 0.Start →
- 8.2SlicesCut a piece out of a string with [start:stop]: the start, up to but not including the stop.Open →
- 8.3String methodsBuilt-in tools for text: change the case, tidy spaces, search, count and replace.Open →
- 8.4Looping through textA for loop can visit every character in a string, one at a time, to count or build something new.Open →
- 8.5Project: username makerUse slices and string methods to make usernames from names and years, and check the input is sensible.Open →
- 8.6Project: Caesar cipherTurn letters into numbers and back again to write secret messages with one of the oldest codes there is.Open →
- CheckCheckpointFive mixed questions on working with text, with loops and decisions mixed back in. Pass them all to finish the chapter.Open →