Get list elements in Python

Get element by index from the beginning

>>> myList=[10,20,30,40,50]
>>> myList[1]
20

Get element by index from the end

>>> myList=[10,20,30,40,50]
>>> myList[-2]
40

See also


Last update : 04/13/2019