2nd to last index python

Solutions on MaxInterview for 2nd to last index python by the best coders in the world

showing results for - "2nd to last index python"
Francisco
07 Jul 2020
1# python code to get 2nd to last item in a list
2my_list = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
3print(my_list[-2])