Looping Over a List

Programming for ML with no experience — if you can type, you can begin

You now own two separate tools. Loops, from the Repetition module, run a block of code again and again. Lists, from this module, hold many values under one name, in order. Put the two together and you get the single most useful pattern in this whole course: a loop that walks a list from the first item to the last, doing the same small job on each one in turn.

🔒 This is a Pro lesson — the interactive figure, worked examples, quiz and practice open with Pro access.

▶ Looping Over a List
← Indexing & SlicingDictionaries →