Indexing & Slicing

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

A ruler starts at 0. Nobody finds that strange: the very first mark on the tape is 0, the next is 1, and the numbers climb from there in order. Python numbers the positions inside a list the same way. The first item in a list sits at position 0, not position 1, because Python is reading the list the way you would read a ruler, from its first mark onward.

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

▶ Indexing & Slicing
← ListsLooping Over a List →