To get the last value in an list using python is a very simple ,we can use Negative indexes , it is the index from the end of the List.
arr_even = [2, 4, 6, 8, 10, 12, 14 ,16 ,18]
print(arr_even[-1])
Output 18
Tutorialshore
To get the last value in an list using python is a very simple ,we can use Negative indexes , it is the index from the end of the List.
arr_even = [2, 4, 6, 8, 10, 12, 14 ,16 ,18]
print(arr_even[-1])
Output 18