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