python check last element of list if it exists code example Example: get last element of array python some_list[-1]