A few common list slicing patterns to serve as a quick reference
Python has a clean syntax for extracting a sublist from a list (known as "slicing" a list). The general pattern is list[start_index:stop_index:step].
For a more in-depth overview of list slicing, refer to this excellent blog post.
9 months ago
Join the discussion!
Patternite © 2021