xxxxxxxxxx
>>> array = [0.0021, 0.12, 0.1224, 0.22]
>>> array[-1]
0.22
>>>
xxxxxxxxxx
# initializing list
test_list = [4, 5, 2, 6, 7, 8, 10]
# initializing N
N = 5
# using list slicing
# Get last N elements from list
res = test_list[-N:]
# The last N elements of list are : [2, 6, 7, 8, 10]