how to get the index of the last element in python code example Example: get the last element of a list python print(list[-1])