how to access last element of an array in python code example
Example 1: access last element of list python
MyList=["Black","Blue","Red","Green"]
print(MyList[-1])
Example 2: python get last element of array
arr = ["cat", "dog", "rabbit"]
last_element = arr[-1]