python get last item of set code example Example 1: get last element of array python some_list[-1] Example 2: get the last element of a list python print(list[-1])