Glossary · Phase 0 · Tools
Index
The position of an item in a list. Python counts from 0, so the first item is at index 0.
Try it now
Same rules as strings: a slice stops before the stop index, and negative indexes count from the end. A slice of a list is a new, shorter list.
Learn it properly
Lists · Keep many values in order, then index, slice and change them. About 20 minutes.
Other terms from the same lesson
- list: An ordered collection of values in square brackets, like [3, 5, 8].
Never trained an AI?
Teach a small one to write, right in your browser. It takes about 20 seconds and needs no account.