Strings
A string is a list of characters, so it has indexes too. With word = "Computing":
| Code | Result |
|---|---|
| len(word) | 9 |
| word[0] | "C" |
| word[0:3] | "Com" (a slice: 0 up to, not including, 3) |
| word.upper() | "COMPUTING" |
| "put" in word | True |
Topic 14 Programming further
KS3 Computing · Real programs keep data in lists, take text apart as strings, split work into subroutines, check their input, save to files, and get tested on purpose.
ProgrammingCambridge Lower Secondary Computing 0860
Say each word, then read what it means. Every one is in the glossary too.
Read it here, or open the study page below to go one step at a time with things to try.
A string is a list of characters, so it has indexes too. With word = "Computing":
| Code | Result |
|---|---|
| len(word) | 9 |
| word[0] | "C" |
| word[0:3] | "Com" (a slice: 0 up to, not including, 3) |
| word.upper() | "COMPUTING" |
| "put" in word | True |
Open the study page and go one step at a time.
One question at a time. The reason shows after each answer.