Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

2nd to last index python

# python code to get 2nd to last item in a list
my_list = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
print(my_list[-2])
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #index #python
ADD COMMENT
Topic
Name
4+9 =