Python: What are negative indexes and why are they used?

To access an element from ordered sequences, we simply use the index of the element, which is the number of the position of that element. The index usually starts from 0, meaning that the first element has the index 0 and the second has 1, and so on.

When we use the index to access elements from the end of a list, it’s called reverse indexing. In reverse indexing, the indexing of elements start from the last element with the index number being ‘−1’. The second last element has the index ‘−2’, and so on. These indexes used in reverse indexing are called negative indexes.