get last object in python code example Example 1: get last element of array python some_list[-1] Example 2: python get last element in list l = [1, 2, 3] l[-1]