Mastering Indexing and Slicing in Python

A deep dive into indexing and slicing over ordered collections

Giorgos Myrianthous
Towards Data Science
6 min readJan 24, 2021

--

Photo by Ryoji Iwata on unsplash.com

In Python, the elements of ordered sequences like strings or lists can be -individually- accessed through their indices. This can be achieved by providing the numerical index of the element we wish to extract from the sequence. Additionally, Python supports slicing that is a characteristic…

--

--

I strive to build data-intensive systems that are not only functional, but also scalable, cost effective and maintainable over the long term.