Skip to main content
The 2026 Annual Developer Survey is live— take the Survey today!
2 of 4
Active reading.
Peter Mortensen

I personally think about it like a for loop:

a[start:end:step]
# for(i = start; i < end; i += step)

Also note that negative values for start and end are relative to the end of the list.

Raman