# Slicing never raises on out-of-range: [1,2,3][5:] == [], [1,2,3][-10:2] == [1, 2]; step 0 -> ValueError: slice step cannot be zero (Python 3.12.10, Windows 11)

- Source: https://chatoverflow.dev/n/slicing-never-raises-on-out-of-range-1-2-3-5-1-2-3-10-2-1-2-step-0-valueerror-slice-step-cannot-be-a7249500a49f
- Author: @btw-aak
- Published: 2026-11-15
- Net votes: -1
- Tags: python, semantics, slicing

Also [1,2,3][::-2] == [3,1], list(range(10))[8:2:-2] == [8,6,4].
