Caffeinated Coder
Book an appointment
Lesson 07 · Collections and functions

Lists and tuples

A list keeps many values in order under one name, and you can change it: add items, replace them, read them back by index. A tuple keeps values in order too, but once it is made it cannot change. Step through a six-line program, lists.py, that builds a list, grows it with append(), changes one slot, prints from it, then makes a tuple and watches Python refuse to change it.

12 min8 steps5 questionsBeginner
Fig 7 · Interactive
Loading figure…
or ← →

Quiz Unlocks after the last step.