Hi, I want to know about What is a negative index in Python
1 Like
Negative index count the value in a list from the end, unlike positive index which counts from the beginning.
For example, if list is [1, 2, 3, 4, 5], then
list[-1] = 5
list[-2] = 4
list[-3] = 3
list[-4] = 2
list[-5] = 1