Strings, Lists, and the Power of Python Collections

1 of 4

ICT · My World Quest — full scheme of work · pioneer

Strings, Lists, and the Power of Python Collections

3 more
1/4
For grown-ups

Companion summary

Have you ever wondered how Spotify builds your playlist, or how Google autocompletes your search? Developers use strings and lists every single day to store names, messages, song titles, and search results. In Python, just writing songs = ["Shape of You", "Blinding Lights"] instantly creates a collection you can sort, search, or shuffle. When you feel confident, try writing a mini contact book that stores names in a list and greets each person by name.

What's in the box?

What's in the box?

Imagine a row of labelled boxes on a shelf. Box 0 holds your name, box 1 holds your favourite colour, box 2 holds your lucky number. You can reach into any box instantly just by knowing its number. Python uses exactly the same idea when it stores sequences of data. Before you dive in, think about this: if you had a sentence like 'hello', how many individual letters does it contain, and how would you grab just the third one? Jot your guess down — you'll be able to check it in a few minutes.

💭 Think about this

If the word 'hello' were stored in Python, which number do you think would point to the letter 'l' that appears first? Why?