Sequence Slicing

Python
Author

Imad Dabbura

Published

December 11, 2022

When we provide a slice to any sequence object (object that implements __getitem__ and __len__), we get back an instance of the same type with the elements in the slice. Here is how slicing works:

slice object has 4 important attributes: