get last few elements from array in python code example Example: python get last element of array arr = ["cat", "dog", "rabbit"] last_element = arr[-1]