Caffeinated Coder
Book an appointment
Lesson 12 · Data structures

Strings: text in memory

A string is how a program holds text: a row of characters in memory, each with a numbered place, just like a list. Follow a short Python program as it reads one character, slices out a few, counts them, and then tries to change one. It can't: strings never change, so +, upper() and join() each build a brand-new string beside the old one.

10 min9 steps5 questionsBeginner
Fig 12 · Interactive
Loading figure…
or ← →

Quiz Unlocks after the last step.