get last index in python array code example
Example 1: get last element of array python
some_list[-1]
Example 2: python get last item in a list
my_list = ["I", "Love", "Python"]
last_item_in_list = my_list[-1]
# last_item_in_list = "Python"
some_list[-1]
my_list = ["I", "Love", "Python"]
last_item_in_list = my_list[-1]
# last_item_in_list = "Python"