MemotivaSequences and slicing

What is slicing in Python?

Sequences and slicing

Audio flashcard · 0:16

Nortren·

What is slicing in Python?

0:16

Slicing is the operation of extracting a subsequence from a sequence using square brackets and a start, stop, and step. The general form is sequence with brackets containing start colon stop colon step. The result is a new sequence containing elements from start up to but not including stop, taking every step element.
docs.python.org