python how to get last element of arra 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]