Question

In Python, how to get list element by index from the end?


Annonce
Ad

Answer

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


[source]
# ID Query