Post

@PythonPr So print(a[-1]) outputs: 3
a[-1] refers to the last element of the list a = [1, 2, 3], which is 3.
English

@PythonPr 3, because i AM genius , because -1 is oppositive to 1, then this turn to 3, Simple
English

@PythonPr Answer: 3
Solution: As we know, indexing starts from 0, from the leftmost item.
However, python provides this feature of negative index, which makes it easy to obtain items from the right.
a[-1] refers to the last (rightmost) item of the list a.
Thus, here it is 3.
English

















