Sean Sean - 4 months ago 23
Python Question

In Python, how to get the value of the n-th item in a list?

I am new to python and don't know how to get the n-th item in a list.
In, item=list(n) gets the n-th item in the array "list", but how do you do it in python?


Answer Source

Consider this code

List = [1,2,3,4] print List[2] To find 3rd element ,n = 2 ,(3 - 1) This is becuase of zero indexing in python