only return last 5 element from list code example
Example 1: access last element of list python
MyList=["Black","Blue","Red","Green"]
print(MyList[-1])
Example 2: how to find last element of list
L=[1,2,3,4,5]
lastElement=L[L.size()]
MyList=["Black","Blue","Red","Green"]
print(MyList[-1])
L=[1,2,3,4,5]
lastElement=L[L.size()]