how to know when at the end of an array in python code example Example: how to get the end of a item in a python array array = [1, 2, 3, 4, 5] print(array[-1])